mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Custom logo and custom url for checkout page should accept any string (relative path) (Fix #1124)
This commit is contained in:
@@ -232,8 +232,8 @@ namespace BTCPayServer.Controllers
|
|||||||
InvoiceId = invoice.Id,
|
InvoiceId = invoice.Id,
|
||||||
DefaultLang = storeBlob.DefaultLang ?? "en",
|
DefaultLang = storeBlob.DefaultLang ?? "en",
|
||||||
HtmlTitle = storeBlob.HtmlTitle ?? "BTCPay Invoice",
|
HtmlTitle = storeBlob.HtmlTitle ?? "BTCPay Invoice",
|
||||||
CustomCSSLink = storeBlob.CustomCSS?.AbsoluteUri,
|
CustomCSSLink = storeBlob.CustomCSS,
|
||||||
CustomLogoLink = storeBlob.CustomLogo?.AbsoluteUri,
|
CustomLogoLink = storeBlob.CustomLogo,
|
||||||
CryptoImage = Request.GetRelativePathOrAbsolute(paymentMethodHandler.GetCryptoImage(paymentMethodId)),
|
CryptoImage = Request.GetRelativePathOrAbsolute(paymentMethodHandler.GetCryptoImage(paymentMethodId)),
|
||||||
BtcAddress = paymentMethodDetails.GetPaymentDestination(),
|
BtcAddress = paymentMethodDetails.GetPaymentDestination(),
|
||||||
BtcDue = accounting.Due.ToString(),
|
BtcDue = accounting.Due.ToString(),
|
||||||
|
|||||||
@@ -353,8 +353,8 @@ namespace BTCPayServer.Controllers
|
|||||||
var storeBlob = CurrentStore.GetStoreBlob();
|
var storeBlob = CurrentStore.GetStoreBlob();
|
||||||
var vm = new CheckoutExperienceViewModel();
|
var vm = new CheckoutExperienceViewModel();
|
||||||
SetCryptoCurrencies(vm, CurrentStore);
|
SetCryptoCurrencies(vm, CurrentStore);
|
||||||
vm.CustomCSS = storeBlob.CustomCSS?.AbsoluteUri;
|
vm.CustomCSS = storeBlob.CustomCSS;
|
||||||
vm.CustomLogo = storeBlob.CustomLogo?.AbsoluteUri;
|
vm.CustomLogo = storeBlob.CustomLogo;
|
||||||
vm.HtmlTitle = storeBlob.HtmlTitle;
|
vm.HtmlTitle = storeBlob.HtmlTitle;
|
||||||
vm.SetLanguages(_LangService, storeBlob.DefaultLang);
|
vm.SetLanguages(_LangService, storeBlob.DefaultLang);
|
||||||
vm.RequiresRefundEmail = storeBlob.RequiresRefundEmail;
|
vm.RequiresRefundEmail = storeBlob.RequiresRefundEmail;
|
||||||
@@ -412,8 +412,8 @@ namespace BTCPayServer.Controllers
|
|||||||
{
|
{
|
||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
blob.CustomLogo = string.IsNullOrWhiteSpace(model.CustomLogo) ? null : new Uri(model.CustomLogo, UriKind.Absolute);
|
blob.CustomLogo = model.CustomLogo;
|
||||||
blob.CustomCSS = string.IsNullOrWhiteSpace(model.CustomCSS) ? null : new Uri(model.CustomCSS, UriKind.Absolute);
|
blob.CustomCSS = model.CustomCSS;
|
||||||
blob.HtmlTitle = string.IsNullOrWhiteSpace(model.HtmlTitle) ? null : model.HtmlTitle;
|
blob.HtmlTitle = string.IsNullOrWhiteSpace(model.HtmlTitle) ? null : model.HtmlTitle;
|
||||||
blob.DefaultLang = model.DefaultLang;
|
blob.DefaultLang = model.DefaultLang;
|
||||||
blob.RequiresRefundEmail = model.RequiresRefundEmail;
|
blob.RequiresRefundEmail = model.RequiresRefundEmail;
|
||||||
|
|||||||
@@ -89,10 +89,9 @@ namespace BTCPayServer.Data
|
|||||||
public CurrencyValue LightningMaxValue { get; set; }
|
public CurrencyValue LightningMaxValue { get; set; }
|
||||||
public bool LightningAmountInSatoshi { get; set; }
|
public bool LightningAmountInSatoshi { get; set; }
|
||||||
|
|
||||||
[JsonConverter(typeof(UriJsonConverter))]
|
public string CustomLogo { get; set; }
|
||||||
public Uri CustomLogo { get; set; }
|
|
||||||
[JsonConverter(typeof(UriJsonConverter))]
|
public string CustomCSS { get; set; }
|
||||||
public Uri CustomCSS { get; set; }
|
|
||||||
public string HtmlTitle { get; set; }
|
public string HtmlTitle { get; set; }
|
||||||
|
|
||||||
public bool RateScripting { get; set; }
|
public bool RateScripting { get; set; }
|
||||||
|
|||||||
@@ -27,10 +27,8 @@ namespace BTCPayServer.Models.StoreViewModels
|
|||||||
public string DefaultLang { get; set; }
|
public string DefaultLang { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Link to a custom CSS stylesheet")]
|
[Display(Name = "Link to a custom CSS stylesheet")]
|
||||||
[Uri]
|
|
||||||
public string CustomCSS { get; set; }
|
public string CustomCSS { get; set; }
|
||||||
[Display(Name = "Link to a custom logo")]
|
[Display(Name = "Link to a custom logo")]
|
||||||
[Uri]
|
|
||||||
public string CustomLogo { get; set; }
|
public string CustomLogo { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Custom HTML title to display on Checkout page")]
|
[Display(Name = "Custom HTML title to display on Checkout page")]
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div class="top-header">
|
<div class="top-header">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="header__icon">
|
<div class="header__icon">
|
||||||
@if (Model.CustomLogoLink != null)
|
@if (!string.IsNullOrEmpty(Model.CustomLogoLink))
|
||||||
{
|
{
|
||||||
<img class="header__icon__img" src="@Model.CustomLogoLink" height="40">
|
<img class="header__icon__img" src="@Model.CustomLogoLink" height="40">
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<bundle name="wwwroot/bundles/checkout-bundle.min.js" />
|
<bundle name="wwwroot/bundles/checkout-bundle.min.js" />
|
||||||
<script>vex.defaultOptions.className = 'vex-theme-btcpay'</script>
|
<script>vex.defaultOptions.className = 'vex-theme-btcpay'</script>
|
||||||
|
|
||||||
@if (Model.CustomCSSLink != null)
|
@if (!string.IsNullOrEmpty(Model.CustomCSSLink))
|
||||||
{
|
{
|
||||||
<link href="@Model.CustomCSSLink" rel="stylesheet" />
|
<link href="@Model.CustomCSSLink" rel="stylesheet" />
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user