btcpayserver/BTCPayServer/Views/UserStores/ListStores.cshtml
Dennis Reimann ad2430496d
UI improvements (#2151)
* UI: Consistent spacing on maintenance view

* UI: Empty states for apps, stores and wallets

* UI: Empty state for file storage

* UI: Toggle invoice selection in list on row click

* Update ChromeDriver

* Fix selector in payjoin test
2020-12-21 12:26:43 +01:00

110 lines
5.4 KiB
Text

@model StoresViewModel
@{
ViewData["Title"] = "Stores";
var storeNameSortOrder = (string)ViewData["StoreNameSortOrder"];
var storeWebsiteSortOrder = (string)ViewData["StoreWebsiteSortOrder"];
var sortByDesc = "Sort by descending...";
var sortByAsc = "Sort by ascending...";
}
<section>
<div class="container">
@if (TempData.HasStatusMessage())
{
<div class="row">
<div class="col-lg-12 text-center">
<partial name="_StatusMessage" />
</div>
</div>
}
<div class="row">
<div class="col-lg-12 section-heading">
<h2>@ViewData["Title"]</h2>
<hr class="primary">
<p>Create and manage store settings.</p>
</div>
</div>
<div class="row button-row">
<div class="col-lg-12 mb-3">
<a asp-action="CreateStore" class="btn btn-primary" role="button" id="CreateStore"><span class="fa fa-plus"></span> Create a new store</a>
</div>
</div>
<div class="row">
<div class="col-lg-12">
@if (Model.Stores.Any())
{
<table class="table table-sm table-responsive-md">
<thead>
<tr>
<th>
<a asp-action="ListStores"
asp-route-sortOrder="@(storeNameSortOrder ?? "asc")"
asp-route-sortOrderColumn="StoreName"
class="text-nowrap"
title="@(storeNameSortOrder == "desc" ? sortByDesc : sortByAsc)">
Name
<span class="fa @(storeNameSortOrder == "asc" ? "fa-sort-alpha-desc" : storeNameSortOrder == "desc" ? "fa-sort-alpha-asc" : "fa-sort")" />
</a>
</th>
<th>
<a asp-action="ListStores"
asp-route-sortOrder="@(storeWebsiteSortOrder ?? "asc")"
asp-route-sortOrderColumn="StoreWebsite"
class="text-nowrap"
title="@(storeWebsiteSortOrder == "desc" ? sortByDesc : sortByAsc)">
Website
<span class="fa @(storeWebsiteSortOrder == "asc" ? "fa-sort-alpha-desc" : storeWebsiteSortOrder == "desc" ? "fa-sort-alpha-asc" : "fa-sort")" />
</a>
</th>
<th style="text-align:right">Actions</th>
</tr>
</thead>
<tbody>
@foreach (var store in Model.Stores)
{
<tr id="store-@store.Id">
<td>
@if (store.IsOwner)
{
<a asp-action="UpdateStore" asp-controller="Stores" asp-route-storeId="@store.Id">@store.Name</a>
}
else
{
@store.Name
}
@if (store.HintWalletWarning)
{
<span class="fa fa-warning text-warning" title="Wallet not setup for this store" id="warninghint_@store.Id"></span>
}
</td>
<td>
@if (!string.IsNullOrEmpty(store.WebSite))
{
<a href="@store.WebSite">@store.WebSite</a>
}
</td>
<td style="text-align:right">
<a asp-action="ListInvoices" asp-controller="Invoice" asp-route-searchTerm="storeid:@store.Id">Invoices</a><span> - </span>
@if (store.IsOwner)
{
<a asp-action="UpdateStore" asp-controller="Stores" asp-route-storeId="@store.Id" id="update-store-@store.Id">Settings</a><span> - </span>
}
<a asp-action="DeleteStore" asp-controller="Stores" asp-route-storeId="@store.Id">Remove</a>
</td>
</tr>
}
</tbody>
</table>
}
else
{
<p class="text-secondary mt-3">
There are no stores yet.
</p>
}
</div>
</div>
</div>
</section>