2022-03-02 18:28:12 +01:00
|
|
|
@using BTCPayServer.Abstractions.Extensions
|
2022-05-24 13:18:16 +09:00
|
|
|
@using BTCPayServer.Services
|
2022-12-14 05:37:31 +01:00
|
|
|
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
|
|
|
@using BTCPayServer.Abstractions.Contracts
|
2022-05-24 13:18:16 +09:00
|
|
|
@inject ThemeSettings Theme
|
2022-12-14 05:37:31 +01:00
|
|
|
@inject IFileService FileService
|
2021-09-03 09:16:36 +02:00
|
|
|
|
2023-06-05 12:27:15 +02:00
|
|
|
<script>if (window.localStorage.getItem('btcpay-hide-sensitive-info') === 'true') { document.documentElement.setAttribute('data-hide-sensitive-info', 'true')}</script>
|
2022-12-14 05:37:31 +01:00
|
|
|
@if (Theme.CustomTheme && !string.IsNullOrEmpty(Theme.CssUri))
|
|
|
|
{ // legacy customization with CSS URI - keep it for backwards-compatibility
|
2022-05-24 13:18:16 +09:00
|
|
|
<link href="@Context.Request.GetRelativePathOrAbsolute(Theme.CssUri)" rel="stylesheet" asp-append-version="true" />
|
2021-09-03 09:16:36 +02:00
|
|
|
}
|
2022-12-14 05:37:31 +01:00
|
|
|
else if (Theme.CustomTheme && !string.IsNullOrEmpty(Theme.CustomThemeFileId))
|
|
|
|
{ // new customization uses theme file id provided by upload
|
|
|
|
@if (Theme.CustomThemeExtension != ThemeExtension.Custom)
|
|
|
|
{ // needs to be added for light and dark, because dark extends light
|
|
|
|
<link href="~/main/themes/default.css" rel="stylesheet" asp-append-version="true" />
|
|
|
|
}
|
|
|
|
@if (Theme.CustomThemeExtension == ThemeExtension.Dark)
|
|
|
|
{
|
|
|
|
<link href="~/main/themes/default-dark.css" rel="stylesheet" asp-append-version="true" />
|
|
|
|
}
|
|
|
|
<link href="@(await FileService.GetFileUrl(Context.Request.GetAbsoluteRootUri(), Theme.CustomThemeFileId))" rel="stylesheet" asp-append-version="true" />
|
|
|
|
}
|
2021-09-03 09:16:36 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
<link href="~/main/themes/default.css" asp-append-version="true" rel="stylesheet" />
|
|
|
|
<link href="~/main/themes/default-dark.css" asp-append-version="true" rel="stylesheet" id="DarkThemeLinkTag" />
|
|
|
|
<script src="~/js/theme-switch.js" asp-append-version="true"></script>
|
|
|
|
<noscript><style>.btcpay-theme-switch { display: none !important; }</style></noscript>
|
|
|
|
}
|
|
|
|
|