btcpayserver/BTCPayServer/Views/Shared/LayoutHeadTheme.cshtml
d11n 4c303d358b
Branding updates for 2.0 (#5947)
* Remove deprecated CSS options

Closes #5945.

* Greenfield: Add brandColor to store APIs

Closes #5946.

* Migrate file IDs to URLs

Closes #5953.

* Greenfield: Add CSS and logo URL to store settings API

Closes #5945.

* Add migration test

* Store and Server branding can reference file's via fileid:ID

* Add PaymentSoundUrl to Store API

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2024-05-09 09:18:02 +09:00

27 lines
1.3 KiB
Plaintext

@using BTCPayServer.Services
@inject ThemeSettings Theme
@inject UriResolver UriResolver
<script>if (window.localStorage.getItem('btcpay-hide-sensitive-info') === 'true') { document.documentElement.setAttribute('data-hide-sensitive-info', 'true')}</script>
@if (Theme.CustomTheme && Theme.CustomThemeCssUrl is not null)
{ // 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" />
}
var themeUrl = await UriResolver.Resolve(this.Context.Request.GetAbsoluteRootUri(), Theme.CustomThemeCssUrl);
<link href="@themeUrl" rel="stylesheet" asp-append-version="true" />
}
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>
}