mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
* UI: Move section navigation to sidebar * Scroll active nav link into view * Move CTAs to top right * Server Settings: Make Policies first page * Responsive table fixes * Spacing fixes * Add breadcrumb samples * store settings fixes * payment request fixes * updates pull payment title * adds invoice detail fix * updates server settings breadcrumbs + copy fix * Don't open Server Settings on Plugins page * Add breadcrumbs to pull payment views * adds breadcrumbs to account * server and store breadcrumb fixes * fixes access tokens * Fix payment processor breadcrumbs * fixes webhook 404 * Final touches * Fix test * Add breadcrumb for email rules page * Design system updates --------- Co-authored-by: dstrukt <gfxdsign@gmail.com>
74 lines
3.8 KiB
Text
74 lines
3.8 KiB
Text
@using BTCPayServer.Components.MainLogo
|
|
@using BTCPayServer.Services
|
|
@using BTCPayServer.Views.Server
|
|
@using BTCPayServer.Views.Stores
|
|
@inject BTCPayServerEnvironment Env
|
|
@model BTCPayServer.Components.StoreSelector.StoreSelectorViewModel
|
|
@functions {
|
|
@* ReSharper disable once CSharpWarnings::CS1998 *@
|
|
#pragma warning disable 1998
|
|
private async Task LogoContent()
|
|
{
|
|
<vc:main-logo />
|
|
@if (Env.NetworkType != NBitcoin.ChainName.Mainnet)
|
|
{
|
|
var type = Env.NetworkType.ToString();
|
|
var displayType = type.Replace("Testnet", "TN").Replace("Regtest", "RT").Replace("Signet", "SN");
|
|
<small class="badge bg-warning rounded-pill ms-1 ms-sm-0" title="@type">@displayType</small>
|
|
}
|
|
}
|
|
private static string StoreName(string title)
|
|
{
|
|
return string.IsNullOrEmpty(title) ? "Unnamed Store" : title;
|
|
}
|
|
#pragma warning restore 1998
|
|
}
|
|
@if (Model.CurrentStoreId == null)
|
|
{
|
|
<a asp-controller="UIHome" asp-action="Index" id="StoreSelectorHome" class="navbar-brand py-2">@{await LogoContent();}</a>
|
|
}
|
|
else
|
|
{
|
|
<a asp-controller="UIStores" asp-action="Index" asp-route-storeId="@Model.CurrentStoreId" id="StoreSelectorHome" class="navbar-brand py-2">@{await LogoContent();}</a>
|
|
}
|
|
@if (Model.Options.Any() || Model.ArchivedCount > 0)
|
|
{
|
|
<div id="StoreSelector">
|
|
<div id="StoreSelectorDropdown" class="dropdown only-for-js">
|
|
<button id="StoreSelectorToggle" class="btn btn-secondary dropdown-toggle rounded-pill px-3 @(Model.CurrentStoreId == null ? "empty-state" : "")" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
@if (!string.IsNullOrEmpty(Model.CurrentStoreLogoUrl))
|
|
{
|
|
<img class="logo" src="@Model.CurrentStoreLogoUrl" alt="@Model.CurrentDisplayName" />
|
|
}
|
|
else
|
|
{
|
|
<vc:icon symbol="nav-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>
|
|
<a asp-controller="UIStores" asp-action="Index" asp-route-storeId="@option.Value" class="dropdown-item@(option.Selected && ViewData.ActivePageClass(ServerNavPages.Stores) != "active" ? " active" : "")" id="StoreSelectorMenuItem-@option.Value">@StoreName(option.Text)</a>
|
|
</li>
|
|
}
|
|
@if (Model.Options.Any())
|
|
{
|
|
<li><hr class="dropdown-divider"></li>
|
|
}
|
|
<li><a asp-controller="UIUserStores" asp-action="CreateStore" class="dropdown-item @ViewData.ActivePageClass(StoreNavPages.Create)" id="StoreSelectorCreate">Create Store</a></li>
|
|
@if (Model.ArchivedCount > 0)
|
|
{
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><a asp-controller="UIUserStores" asp-action="ListStores" asp-route-archived="true" class="dropdown-item @ViewData.ActivePageClass(StoreNavPages.Index)" id="StoreSelectorArchived">@Model.ArchivedCount Archived Store@(Model.ArchivedCount == 1 ? "" : "s")</a></li>
|
|
}
|
|
@*
|
|
<li permission="@Policies.CanModifyServerSettings"><hr class="dropdown-divider"></li>
|
|
<li permission="@Policies.CanModifyServerSettings"><a asp-controller="UIServer" asp-action="ListStores" class="dropdown-item @ViewData.ActivePageClass(ServerNavPages.Stores)" id="StoreSelectorAdminStores">Admin Store Overview</a></li>
|
|
*@
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
}
|