Files
BTCPayServerPlugins/Plugins/BTCPayServer.Plugins.LiquidPlus/Views/Shared/StoreNavLiquidExtension.cshtml
2024-10-29 12:46:59 +01:00

14 lines
671 B
Plaintext

@using BTCPayServer.Abstractions.Contracts
@using BTCPayServer.Plugins.LiquidPlus.Controllers
@using Microsoft.AspNetCore.Mvc.TagHelpers
@inject IScopeProvider ScopeProvider
@{
var storeId = ScopeProvider.GetCurrentStoreId();
var isActive = !string.IsNullOrEmpty(storeId) && ViewContext.RouteData.Values.TryGetValue("Controller", out var controller) && controller is not null &&
nameof(StoreLiquidController).StartsWith(controller?.ToString(), StringComparison.InvariantCultureIgnoreCase);
}
<a class="nav-link @(isActive ? "active" : string.Empty)" asp-route-storeId="@storeId" asp-action="GenerateLiquidScript" asp-controller="StoreLiquid">Liquid</a>