Files
BTCPayServerPlugins/Plugins/BTCPayServer.Plugins.Subscriptions/Subscriptions/NavExtension.cshtml
2024-04-11 15:10:57 +02:00

44 lines
5.3 KiB
Plaintext

@using BTCPayServer.Client
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using BTCPayServer.Views.Apps
@using BTCPayServer.Services.Apps
@using BTCPayServer
@using BTCPayServer.Abstractions.Extensions
@using BTCPayServer.Plugins.Subscriptions
@inject AppService AppService;
@model BTCPayServer.Components.MainNav.MainNavViewModel
@{
var store = Context.GetStoreData();
}
@if (store != null)
{
var appType = AppService.GetAppType(SubscriptionApp.AppType)!;
<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}")">
<svg
style=" height: 15px;
margin-left: 5px;
margin-right: 5px;"
xmlns="http://www.w3.org/2000/svg"
shape-rendering="geometricPrecision"
text-rendering="geometricPrecision"
image-rendering="optimizeQuality"
fill-rule="evenodd" clip-rule="evenodd"
viewBox="0 0 512 496.61">
<path
fill="currentColor"
d="M42.09 42.35h38.82v51.8c0 14.4 6.7 27.13 17.51 35.98 9.13 7.49 21.28 12.13 34.26 12.13 12.99 0 25.14-4.64 34.28-12.13 10.8-8.85 17.5-21.58 17.5-35.98v-51.8h78.39v51.8c0 14.4 6.69 27.13 17.5 35.98 9.13 7.49 21.29 12.13 34.27 12.13 12.98 0 25.14-4.64 34.27-12.13 10.81-8.85 17.51-21.58 17.51-35.98v-51.8h40.52c11.56 0 22.08 4.75 29.72 12.38 7.64 7.61 12.38 18.14 12.38 29.72v144.24a157.45 157.45 0 0 0-17.98-5.73v-58.75H17.98v244.83c0 18.19 14.89 33.1 33.1 33.1h201.39a154.57 154.57 0 0 0 10.28 17.97H42.09c-11.54 0-22.06-4.73-29.7-12.36C4.74 440.08 0 429.57 0 418.03V84.44c0-11.56 4.74-22.07 12.36-29.7 7.65-7.65 18.18-12.39 29.73-12.39zm324.19 430.69c5.37 1.43 8.56 6.95 7.13 12.32-1.44 5.37-6.96 8.56-12.32 7.13a120.88 120.88 0 0 1-13.74-4.57c-25.72-10.29-46.32-28.83-59.5-51.65-15.46-26.74-20.7-59.38-12.09-91.54 8.61-32.15 29.47-57.78 56.22-73.23 26.73-15.46 59.38-20.71 91.54-12.08 11.24 3.01 21.69 7.51 31.18 13.23a120.08 120.08 0 0 1 21 16.1l-.55-5.33c-.56-5.51 3.44-10.44 8.95-11 5.51-.56 10.43 3.45 11 8.96l2.88 27.82c.1 1.02.05 2.03-.15 2.99-.42 4.99-4.53 8.99-9.66 9.15l-27.95.99c-5.52.17-10.15-4.18-10.32-9.7-.17-5.53 4.17-10.15 9.69-10.32l1.12-.04c-4.98-4.63-10.47-8.78-16.4-12.37-7.92-4.78-16.63-8.53-25.99-11.04-26.82-7.18-54.01-2.82-76.26 10.03-22.29 12.84-39.66 34.21-46.84 61.03-7.19 26.82-2.84 54.01 10.02 76.28 6.39 11.09 14.89 20.97 25.13 28.97 10.19 7.98 23.41 14.54 35.91 17.87zm21.37-160.44h20.09l-.48 12.66c8.45.53 15.83 1.37 22.16 2.54l-4.59 24.51H401.1c-3.69 0-6.15.58-7.36 1.74-1.21 1.16-1.87 3.38-1.98 6.64l9.97 1.11c12.13 1.37 20.49 4.48 25.08 9.34 4.58 4.85 6.88 11.12 6.88 18.82 0 7.7-.8 13.85-2.38 18.43-1.58 4.58-3.85 8.09-6.8 10.52-5.38 4.11-12.44 6.49-21.19 7.12l-.48 15.97h-20.41l.64-15.97c-10.02-.73-18.51-2.01-25.47-3.8l4.58-25.15c8.76 2.32 17.93 3.48 27.53 3.48 4.01 0 7.75-.21 11.23-.63v-6.65l-9.81-1.11c-12.66-1.26-21.09-4.95-25.31-11.07-3.69-5.37-5.53-12.39-5.53-21.04 0-11.38 2.34-19.66 7.04-24.83 4.69-5.17 11.3-8.34 19.85-9.49l.47-13.14zm10.79 163.84c-13.97 1.17-11.44 21.17 1.08 20.13 7.13-.34 14.89-1.52 21.82-3.25 12.86-3.22 8.01-22.79-4.91-19.55-5.95 1.45-11.88 2.3-17.99 2.67zm51.19-17.66c-10.86 7.61.68 24.13 11.55 16.52 5.89-4.05 11.85-9.12 16.82-14.25 9.13-9.13-4.81-23.69-14.47-14.04-4 4.19-9.12 8.49-13.9 11.77zm34.42-42.03c-5.4 11.87 12.83 20.48 18.43 8.16 3.08-6.97 5.14-13.44 7.06-20.79 3.17-12.65-16.32-17.82-19.6-4.69-1.74 6.23-3.25 11.36-5.89 17.32zm7.88-53.71c2.11 12.71 20.07 10.98 20.07-1.51l-.08-1.09c-1-7.42-2.51-14.26-4.77-21.42-4.29-12.87-23.3-6.18-19.19 6.16a105.17 105.17 0 0 1 3.97 17.86zm-294.54-43.78h49.42c-6.41 17.06-9.94 35.54-9.94 54.84 0 3.59.14 7.16.38 10.69h-39.86c-4.21 0-7.69-3.45-7.69-7.67v-50.18c0-4.22 3.46-7.68 7.69-7.68zm0-106.69h60.3c4.23 0 7.68 3.47 7.68 7.68v50.17c0 4.2-3.47 7.68-7.68 7.68h-60.3c-4.21 0-7.69-3.46-7.69-7.68v-50.17c0-4.23 3.46-7.68 7.69-7.68zm-121.63 0h60.3c4.23 0 7.69 3.47 7.69 7.68v50.17c0 4.2-3.48 7.68-7.69 7.68h-60.3c-4.21 0-7.68-3.46-7.68-7.68v-50.17c0-4.23 3.46-7.68 7.68-7.68zm243.25 0h60.31c3.57 0 6.58 2.48 7.44 5.78-27.59 1.04-53.33 9.25-75.43 22.81v-20.91c0-4.23 3.46-7.68 7.68-7.68zM75.76 319.26h60.3c4.23 0 7.69 3.48 7.69 7.68v50.18c0 4.2-3.48 7.67-7.69 7.67h-60.3c-4.21 0-7.68-3.45-7.68-7.67v-50.18c0-4.22 3.46-7.68 7.68-7.68zM294.3 16.66C294.3 7.47 303.39 0 314.62 0c11.24 0 20.33 7.47 20.33 16.66v77.49c0 9.19-9.09 16.66-20.33 16.66-11.23 0-20.32-7.47-20.32-16.66V16.66zm-181.94 0c0-9.19 9.09-16.66 20.32-16.66 11.24 0 20.33 7.47 20.33 16.66v77.49c0 9.19-9.09 16.66-20.33 16.66-11.23 0-20.32-7.47-20.32-16.66V16.66z"/>
</svg>
<span>@appType.Description</span>
</a>
</li>
@foreach (var app in Model.Apps.Where(app => app.AppType == appType.Type))
{
<li class="nav-item nav-item-sub" permission="@Policies.CanModifyStoreSettings">
<a asp-area="" asp-controller="Subscription" asp-action="Update" 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>
}
}