Refactor themes (#2794)

* Remove Bootstrap/Creative CSS file customizability

Customizations should be done using themes

* Remove deprecated Casa and Classic themes

They are still available in the design system repo and should be added as custom theme CSS file

* Use either standard or custom theme

* Remove deprecated themes

* Improve theme select UI

* Finish and refactor theme switching

* updates theme copy

* Update BTCPayServer/Views/Server/Theme.cshtml

Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>

* Combine creative.css and site.css

Co-authored-by: dstrukt <gfxdsign@gmail.com>
Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com>
This commit is contained in:
d11n
2021-09-03 09:16:36 +02:00
committed by GitHub
parent e5699f674b
commit fe18e71538
21 changed files with 342 additions and 1024 deletions

View File

@@ -8,16 +8,11 @@ namespace BTCPayServer
{
public static async Task<PoliciesSettings> GetPolicies(this ISettingsRepository settingsRepository)
{
return (await settingsRepository.GetSettingAsync<PoliciesSettings>()) ?? new PoliciesSettings();
return await settingsRepository.GetSettingAsync<PoliciesSettings>() ?? new PoliciesSettings();
}
public static async Task<ThemeSettings> GetTheme(this ISettingsRepository settingsRepository)
{
var result = await settingsRepository.GetSettingAsync<ThemeSettings>() ?? new ThemeSettings();
result.ThemeCssUri = string.IsNullOrWhiteSpace(result.ThemeCssUri) ? "/main/themes/default.css" : result.ThemeCssUri;
result.CustomThemeCssUri = string.IsNullOrWhiteSpace(result.CustomThemeCssUri) ? null : result.CustomThemeCssUri;
result.BootstrapCssUri = string.IsNullOrWhiteSpace(result.BootstrapCssUri) ? "/main/bootstrap/bootstrap.css" : result.BootstrapCssUri;
result.CreativeStartCssUri = string.IsNullOrWhiteSpace(result.CreativeStartCssUri) ? "/main/bootstrap/creative.css" : result.CreativeStartCssUri;
return result;
return await settingsRepository.GetSettingAsync<ThemeSettings>() ?? new ThemeSettings();
}
}
}