mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
d5d0be5824
* Editorconfig: Add space_before_self_closing setting This was a difference between the way dotnet-format and Rider format code. See https://www.jetbrains.com/help/rider/EditorConfig_Index.html * Editorconfig: Keep 4 spaces indentation for Swagger JSON files They are all formatted that way, let's keep it like that. * Apply dotnet-format, mostly white-space related changes
55 lines
1.3 KiB
C#
55 lines
1.3 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace BTCPayServer.Services;
|
|
|
|
public enum ThemeExtension
|
|
{
|
|
[Display(Name = "Does not extend a BTCPay Server theme, fully custom")]
|
|
Custom,
|
|
[Display(Name = "Extends the BTCPay Server Light theme")]
|
|
Light,
|
|
[Display(Name = "Extends the BTCPay Server Dark theme")]
|
|
Dark
|
|
}
|
|
|
|
public class ThemeSettings
|
|
{
|
|
[Display(Name = "Use custom theme")]
|
|
public bool CustomTheme { get; set; }
|
|
|
|
[Display(Name = "Custom Theme Extension Type")]
|
|
public ThemeExtension CustomThemeExtension { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
|
[MaxLength(500)]
|
|
[Display(Name = "Custom Theme CSS URL")]
|
|
public string CustomThemeCssUri { get; set; }
|
|
|
|
[Display(Name = "Custom Theme File")]
|
|
[JsonIgnore]
|
|
public IFormFile CustomThemeFile { get; set; }
|
|
|
|
public string CustomThemeFileId { get; set; }
|
|
|
|
[Display(Name = "Logo")]
|
|
[JsonIgnore]
|
|
public IFormFile LogoFile { get; set; }
|
|
|
|
public string LogoFileId { get; set; }
|
|
|
|
public bool FirstRun { get; set; }
|
|
|
|
public override string ToString()
|
|
{
|
|
// no logs
|
|
return string.Empty;
|
|
}
|
|
|
|
public string CssUri
|
|
{
|
|
get => CustomTheme ? CustomThemeCssUri : "/main/themes/default.css";
|
|
}
|
|
}
|