mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
7ccf0c3612
This adds a "Custom Theme CSS file" to the "Server settings: Theme" page. It works similar to the custom bootstrap and creative start fields, but is only added to the head in case it is set. The main idea here is that users would choose one of our predefined themes and have the option to override specific values. The other apporach would be to let the custom theme replace the predefined one, but this could lead to issues in case we extend the set of variables, which would be unset then. This way users can copy a predefined theme and override all variables or just the ones they want to customize. The help icon besides the label links to a page in the docs I'm currently working on.
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace BTCPayServer.Services
|
|
{
|
|
public class ThemeSettings
|
|
{
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
|
[MaxLength(500)]
|
|
[Display(Name = "Select Theme")]
|
|
public string ThemeCssUri { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
|
[MaxLength(500)]
|
|
[Display(Name = "Custom Theme CSS file")]
|
|
public string CustomThemeCssUri { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
|
[MaxLength(500)]
|
|
[Display(Name = "Custom bootstrap CSS file")]
|
|
public string BootstrapCssUri { get; set; }
|
|
|
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
|
[Display(Name = "Custom Creative Start CSS file")]
|
|
public string CreativeStartCssUri { get; set; }
|
|
public bool FirstRun { get; set; }
|
|
public override string ToString()
|
|
{
|
|
// no logs
|
|
return string.Empty;
|
|
}
|
|
}
|
|
}
|