mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 22:46:49 +01:00
* Support Admin being able to view stores * fix null check * Delete obsolete empty view * Add test * Apply CanViewStoreSettings policy changes Taken from #5719 * Fix Selenium tests * Update dashboard permission requirement --------- Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
44 lines
1.9 KiB
Text
44 lines
1.9 KiB
Text
@using BTCPayServer.Client
|
|
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
|
@using BTCPayServer.Views.Apps
|
|
@using BTCPayServer.Plugins.PointOfSale
|
|
@using BTCPayServer.Services.Apps
|
|
@inject AppService AppService;
|
|
@model BTCPayServer.Components.MainNav.MainNavViewModel
|
|
@{
|
|
var store = Context.GetStoreData();
|
|
}
|
|
|
|
@if (store != null)
|
|
{
|
|
var appType = AppService.GetAppType(PointOfSaleAppType.AppType)!;
|
|
var apps = Model.Apps.Where(app => app.AppType == appType.Type).ToList();
|
|
<li class="nav-item" permission="@Policies.CanModifyStoreSettings">
|
|
<a asp-area="" asp-controller="UIApps" asp-action="CreateApp" asp-route-storeId="@store.Id" asp-route-appType="@appType.Type" class="nav-link @ViewData.IsActivePage(AppsNavPages.Create, appType.Type)" id="@($"StoreNav-Create{appType.Type}")">
|
|
<vc:icon symbol="pointofsale" />
|
|
<span>@appType.Description</span>
|
|
</a>
|
|
</li>
|
|
@if (apps.Any())
|
|
{
|
|
<li class="nav-item" not-permission="@Policies.CanModifyStoreSettings" permission="@Policies.CanViewStoreSettings">
|
|
<span class="nav-link">
|
|
<vc:icon symbol="pointofsale" />
|
|
<span>@appType.Description</span>
|
|
</span>
|
|
</li>
|
|
}
|
|
@foreach (var app in apps)
|
|
{
|
|
<li class="nav-item nav-item-sub" permission="@Policies.CanViewStoreSettings">
|
|
<a asp-area="" asp-controller="UIPointOfSale" asp-action="UpdatePointOfSale" asp-route-appId="@app.Id" class="nav-link @ViewData.IsActivePage(AppsNavPages.Update, app.Id)" id="@($"StoreNav-App-{app.Id}")">
|
|
<span>@app.AppName</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item nav-item-sub" not-permission="@Policies.CanViewStoreSettings">
|
|
<a asp-area="" asp-controller="UIPointOfSale" asp-action="ViewPointOfSale" asp-route-appId="@app.Id" class="nav-link">
|
|
<span>@app.AppName</span>
|
|
</a>
|
|
</li>
|
|
}
|
|
}
|