diff --git a/BTCPayServer/HostedServices/CssThemeManager.cs b/BTCPayServer/HostedServices/CssThemeManager.cs
index 7545d1c53..3ab7c671f 100644
--- a/BTCPayServer/HostedServices/CssThemeManager.cs
+++ b/BTCPayServer/HostedServices/CssThemeManager.cs
@@ -21,12 +21,16 @@ namespace BTCPayServer.HostedServices
{
public void Update(ThemeSettings data)
{
+ if (String.IsNullOrWhiteSpace(data.ThemeCssUri))
+ _themeUri = "/css/btcpay-theme.css";
+ else
+ _themeUri = data.ThemeCssUri;
+
if (String.IsNullOrWhiteSpace(data.BootstrapCssUri))
- _bootstrapUri = "/vendor/bootstrap4/css/bootstrap.css?v=" + DateTime.Now.Ticks;
+ _bootstrapUri = "/vendor/bootstrap/bootstrap.css";
else
_bootstrapUri = data.BootstrapCssUri;
-
if (String.IsNullOrWhiteSpace(data.CreativeStartCssUri))
_creativeStartUri = "/vendor/bootstrap4-creativestart/creative.css?v=" + DateTime.Now.Ticks;
else
@@ -34,6 +38,12 @@ namespace BTCPayServer.HostedServices
FirstRun = data.FirstRun;
}
+ private string _themeUri;
+ public string ThemeUri
+ {
+ get { return _themeUri; }
+ }
+
private string _bootstrapUri;
public string BootstrapUri
{
@@ -77,7 +87,7 @@ namespace BTCPayServer.HostedServices
public void OnActionExecuted(ActionExecutedContext context)
{
-
+
}
public void OnActionExecuting(ActionExecutingContext context)
@@ -94,6 +104,10 @@ namespace BTCPayServer.HostedServices
{
policies.Clear();
}
+ if (manager.ThemeUri != null && Uri.TryCreate(manager.ThemeUri, UriKind.Absolute, out uri))
+ {
+ policies.Clear();
+ }
}
}
}
diff --git a/BTCPayServer/Services/ThemesSettings.cs b/BTCPayServer/Services/ThemesSettings.cs
index c27e2e3bd..73061b79b 100644
--- a/BTCPayServer/Services/ThemesSettings.cs
+++ b/BTCPayServer/Services/ThemesSettings.cs
@@ -9,6 +9,11 @@ namespace BTCPayServer.Services
{
public class ThemeSettings
{
+ [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
+ [MaxLength(500)]
+ [Display(Name = "Custom theme CSS file")]
+ public string ThemeCssUri { get; set; }
+
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
[MaxLength(500)]
[Display(Name = "Custom bootstrap CSS file")]
diff --git a/BTCPayServer/Views/AppsPublic/ViewCrowdfund.cshtml b/BTCPayServer/Views/AppsPublic/ViewCrowdfund.cshtml
index 03de8cb8c..98fada78c 100644
--- a/BTCPayServer/Views/AppsPublic/ViewCrowdfund.cshtml
+++ b/BTCPayServer/Views/AppsPublic/ViewCrowdfund.cshtml
@@ -14,6 +14,7 @@
+
@if (Model.CustomCSSLink != null)
{
@@ -32,7 +33,7 @@
@if (!string.IsNullOrEmpty(Model.EmbeddedCSS))
{
- @Safe.Raw($"");
+ @Safe.Raw($"");
}
diff --git a/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml b/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml
index 732253a20..553999696 100644
--- a/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml
+++ b/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml
@@ -22,6 +22,7 @@
+
@if (Model.CustomCSSLink != null)
{
@@ -47,15 +48,15 @@
max-width: 320px;
margin: auto;
}
-
- .js-cart-item-count::-webkit-inner-spin-button,
- .js-cart-item-count::-webkit-outer-spin-button {
+
+ .js-cart-item-count::-webkit-inner-spin-button,
+ .js-cart-item-count::-webkit-outer-spin-button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
- margin: 0;
+ margin: 0;
}
-
+
@if (!string.IsNullOrEmpty(Model.EmbeddedCSS))
{
@@ -318,7 +319,7 @@
@String.Format(Model.ButtonText, @item.Price.Formatted)
@if (item.Inventory.HasValue)
{
-
+
@if (item.Inventory > 0)
{
@@ -453,7 +454,7 @@
}else if (anyInventoryItems)
{
-  
+  
}
diff --git a/BTCPayServer/Views/PaymentRequest/ViewPaymentRequest.cshtml b/BTCPayServer/Views/PaymentRequest/ViewPaymentRequest.cshtml
index 2b5249b27..3d8111b88 100644
--- a/BTCPayServer/Views/PaymentRequest/ViewPaymentRequest.cshtml
+++ b/BTCPayServer/Views/PaymentRequest/ViewPaymentRequest.cshtml
@@ -15,6 +15,7 @@
+
@if (Model.CustomCSSLink != null)
{
@@ -31,7 +32,7 @@
}
-
+
@Safe.Raw(Model.EmbeddedCSS)
@@ -185,8 +186,8 @@ else
Pay now
-