btcpayserver/BTCPayServer/Views/Shared/Monero/StoreNavMoneroExtension.cshtml

17 lines
1 KiB
Text
Raw Normal View History

@using BTCPayServer.Services.Altcoins.Monero.Configuration
@using BTCPayServer.Services.Altcoins.Monero.UI
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using BTCPayServer.Abstractions.Contracts
2019-09-30 10:32:43 +02:00
@inject SignInManager<ApplicationUser> SignInManager;
@inject MoneroLikeConfiguration MoneroLikeConfiguration;
@inject IScopeProvider ScopeProvider
2019-09-30 10:32:43 +02:00
@{
var storeId = ScopeProvider.GetCurrentStoreId();
var isActive = !string.IsNullOrEmpty(storeId) && ViewContext.RouteData.Values.TryGetValue("Controller", out var controller) && controller is not null &&
nameof(UIMoneroLikeStoreController).StartsWith(controller.ToString() ?? string.Empty, StringComparison.InvariantCultureIgnoreCase);
2019-09-30 10:32:43 +02:00
}
@if (SignInManager.IsSignedIn(User) && User.IsInRole(Roles.ServerAdmin) && MoneroLikeConfiguration.MoneroLikeConfigurationItems.Any())
{
<a class="nav-link @(isActive ? "active" : string.Empty)" asp-route-storeId="@storeId" asp-action="GetStoreMoneroLikePaymentMethods" asp-controller="UIMoneroLikeStore">Monero</a>
2019-09-30 10:32:43 +02:00
}