mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-06 18:41:12 +01:00
* Add dashboard and chart basics * More widgets * Make widgets responsive * Layout dashboard * Prepare ExplorerClient * Switch to Chartist * Dynamic data for store numbers and recent transactions tiles * Dynamic data for recent invoices tile * Improvements * Plug NBXPlorer DB * Properly filter by code * Reorder cheat mode button * AJAX update for graph data * Fix create invoice button * Retry connection on transient issues * App Top Items stats * Design updates * App Sales stats * Add points for weekly histogram, set last point to current balance Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
69 lines
3.3 KiB
Text
69 lines
3.3 KiB
Text
@inject BTCPayServer.Services.BTCPayServerEnvironment _env
|
|
@inject SignInManager<ApplicationUser> _signInManager
|
|
@model BTCPayServer.Components.StoreSelector.StoreSelectorViewModel
|
|
@addTagHelper *, BundlerMinifier.TagHelpers
|
|
|
|
@functions {
|
|
@* ReSharper disable once CSharpWarnings::CS1998 *@
|
|
private async Task LogoContent()
|
|
{
|
|
var logoSrc = $"{ViewContext.HttpContext.Request.PathBase}/img/logo.svg";
|
|
<svg xmlns="http://www.w3.org/2000/svg" role="img" alt="BTCPay Server" class="logo"><use href="@logoSrc#small" class="logo-small" /><use href="@logoSrc#large" class="logo-large" /></svg>
|
|
@if (_env.NetworkType != NBitcoin.ChainName.Mainnet)
|
|
{
|
|
<span class="badge bg-warning ms-1 ms-sm-0" style="font-size:10px;">@_env.NetworkType.ToString()</span>
|
|
}
|
|
}
|
|
|
|
private string StoreName(string title)
|
|
{
|
|
return string.IsNullOrEmpty(title) ? "Unnamed Store" : title;
|
|
}
|
|
}
|
|
|
|
@if (Model.CurrentStoreId == null)
|
|
{
|
|
<a href="~/" class="navbar-brand py-2 js-scroll-trigger">@{await LogoContent();}</a>
|
|
}
|
|
else if (Model.CurrentStoreIsOwner)
|
|
{
|
|
<a asp-controller="UIStores" asp-action="Dashboard" asp-route-storeId="@Model.CurrentStoreId" class="navbar-brand py-2 js-scroll-trigger">@{await LogoContent();}</a>
|
|
}
|
|
else
|
|
{
|
|
<a asp-controller="UIInvoice" asp-action="ListInvoices" asp-route-storeId="@Model.CurrentStoreId" class="navbar-brand py-2 js-scroll-trigger">@{await LogoContent();}</a>
|
|
}
|
|
|
|
<div id="StoreSelector">
|
|
@if (Model.Options.Count > 0)
|
|
{
|
|
<div id="StoreSelectorDropdown" class="dropdown only-for-js">
|
|
<button id="StoreSelectorToggle" class="btn btn-secondary dropdown-toggle rounded-pill px-3 @(Model.CurrentStoreId == null ? "text-secondary" : "")" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
<vc:icon symbol="store"/>
|
|
<span>@(Model.CurrentStoreId == null ? "Select Store" : Model.CurrentDisplayName)</span>
|
|
<vc:icon symbol="caret-down"/>
|
|
</button>
|
|
<ul id="StoreSelectorMenu" class="dropdown-menu" aria-labelledby="StoreSelectorToggle">
|
|
@foreach (var option in Model.Options)
|
|
{
|
|
<li>
|
|
@if (option.IsOwner)
|
|
{
|
|
<a asp-controller="UIStores" asp-action="Dashboard" asp-route-storeId="@option.Value" class="dropdown-item@(option.Selected ? " active" : "")" id="StoreSelectorMenuItem-@option.Value">@StoreName(option.Text)</a>
|
|
}
|
|
else
|
|
{
|
|
<a asp-controller="UIInvoice" asp-action="ListInvoices" asp-route-storeId="@option.Value" class="dropdown-item@(option.Selected ? " active" : "")" id="StoreSelectorMenuItem-@option.Value">@StoreName(option.Text)</a>
|
|
}
|
|
</li>
|
|
}
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><a asp-controller="UIUserStores" asp-action="CreateStore" class="dropdown-item" id="StoreSelectorCreate">Create Store</a></li>
|
|
</ul>
|
|
</div>
|
|
}
|
|
else if (_signInManager.IsSignedIn(User))
|
|
{
|
|
<a asp-controller="UIUserStores" asp-action="CreateStore" class="btn btn-primary w-100 rounded-pill" id="StoreSelectorCreate">Create Store</a>
|
|
}
|
|
</div>
|