btcpayserver/BTCPayServer/Views/UIServer/ListStores.cshtml
2024-07-25 22:46:02 +09:00

77 lines
3.1 KiB
Plaintext

@model BTCPayServer.Models.StoreViewModels.ListStoresViewModel
@{
Layout = "_Layout";
ViewData.SetActivePage(ServerNavPages.Stores, "Store Overview");
}
<div class="sticky-header">
<h2 class="my-1" text-translate="true">@ViewData["Title"]</h2>
</div>
<partial name="_StatusMessage" />
@if (Model.Stores.Any())
{
<table class="table table-hover">
<thead>
<tr>
<th>Store</th>
<th>Users</th>
</tr>
</thead>
<tbody>
@foreach (var store in Model.Stores)
{
var detailsId = $"store_details_{store.StoreId}";
<tr id="store_@store.StoreId" class="mass-action-row">
<td>
<a asp-controller="UIStores" asp-action="Index" asp-route-storeId="@store.StoreId" id="Store-@store.StoreId">
@store.StoreName
</a>
@if (store.Archived)
{
<span class="badge bg-info ms-2">archived</span>
}
</td>
<td>@store.Users.Count User@(store.Users.Count == 1 ? "" : "s")</td>
<td class="text-end">
<div class="d-inline-flex align-items-center gap-2">
<button class="accordion-button collapsed only-for-js ms-0 d-inline-block" type="button" data-bs-toggle="collapse" data-bs-target="#@detailsId" aria-expanded="false" aria-controls="@detailsId">
<vc:icon symbol="caret-down" />
</button>
</div>
</td>
</tr>
<tr id="@detailsId" class="store-details-row collapse">
<td colspan="5" class="border-top-0">
@if (store.Users.Any())
{
<ul class="mb-0 p-0">
@foreach (var user in store.Users)
{
<li class="py-1 d-flex gap-2">
<a asp-controller="UIServer" asp-action="User" asp-route-userId="@user.ApplicationUser.Id">@user.ApplicationUser.Email</a>
<span class="badge bg-light">@user.StoreRoleId</span>
@if (store.Archived)
{
<span class="badge bg-info">archived</span>
}
</li>
}
</ul>
}
else
{
<span class="text-secondary">No users</span>
}
</td>
</tr>
}
</tbody>
</table>
}
else
{
<p class="text-secondary mt-3">
There are no stores yet.
</p>
}