diff --git a/BTCPayServer/Controllers/AppsController.PointOfSale.cs b/BTCPayServer/Controllers/AppsController.PointOfSale.cs index ae8d9dd4f..8505b4423 100644 --- a/BTCPayServer/Controllers/AppsController.PointOfSale.cs +++ b/BTCPayServer/Controllers/AppsController.PointOfSale.cs @@ -78,6 +78,10 @@ namespace BTCPayServer.Controllers public string CustomCSSLink { get; set; } + + public string EmbeddedCSS { get; set; } + + public string Description { get; set; } public string NotificationEmail { get; set; } public string NotificationUrl { get; set; } public bool? RedirectAutomatically { get; set; } @@ -109,6 +113,8 @@ namespace BTCPayServer.Controllers CustomTipText = settings.CustomTipText ?? PointOfSaleSettings.CUSTOM_TIP_TEXT_DEF, CustomTipPercentages = settings.CustomTipPercentages != null ? string.Join(",", settings.CustomTipPercentages) : string.Join(",", PointOfSaleSettings.CUSTOM_TIP_PERCENTAGES_DEF), CustomCSSLink = settings.CustomCSSLink, + EmbeddedCSS = settings.EmbeddedCSS, + Description = settings.Description, NotificationEmail = settings.NotificationEmail, NotificationUrl = settings.NotificationUrl, RedirectAutomatically = settings.RedirectAutomatically.HasValue? settings.RedirectAutomatically.Value? "true": "false" : "" @@ -187,6 +193,8 @@ namespace BTCPayServer.Controllers CustomCSSLink = vm.CustomCSSLink, NotificationUrl = vm.NotificationUrl, NotificationEmail = vm.NotificationEmail, + Description = vm.Description, + EmbeddedCSS = vm.EmbeddedCSS, RedirectAutomatically = string.IsNullOrEmpty(vm.RedirectAutomatically)? (bool?) null: bool.Parse(vm.RedirectAutomatically) }); diff --git a/BTCPayServer/Controllers/AppsPublicController.cs b/BTCPayServer/Controllers/AppsPublicController.cs index 880ae8d0b..35044773e 100644 --- a/BTCPayServer/Controllers/AppsPublicController.cs +++ b/BTCPayServer/Controllers/AppsPublicController.cs @@ -87,7 +87,9 @@ namespace BTCPayServer.Controllers CustomTipText = settings.CustomTipText, CustomTipPercentages = settings.CustomTipPercentages, CustomCSSLink = settings.CustomCSSLink, - AppId = appId + AppId = appId, + Description = settings.Description, + EmbeddedCSS = settings.EmbeddedCSS }); } diff --git a/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs b/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs index 9affda5ae..610bf94c7 100644 --- a/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/UpdatePointOfSaleViewModel.cs @@ -85,5 +85,7 @@ namespace BTCPayServer.Models.AppViewModels }, nameof(SelectListItem.Value), nameof(SelectListItem.Text), RedirectAutomatically); public bool NotificationEmailWarning { get; set; } + public string EmbeddedCSS { get; set; } + public string Description { get; set; } } } diff --git a/BTCPayServer/Models/AppViewModels/ViewPointOfSaleViewModel.cs b/BTCPayServer/Models/AppViewModels/ViewPointOfSaleViewModel.cs index 9d87769e2..8c83dae6e 100644 --- a/BTCPayServer/Models/AppViewModels/ViewPointOfSaleViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/ViewPointOfSaleViewModel.cs @@ -50,5 +50,7 @@ namespace BTCPayServer.Models.AppViewModels public int[] CustomTipPercentages { get; set; } public string CustomCSSLink { get; set; } + public string Description { get; set; } + public string EmbeddedCSS { get; set; } } } diff --git a/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml b/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml index 4b364fac6..71ac7bfbf 100644 --- a/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml +++ b/BTCPayServer/Views/Apps/UpdatePointOfSale.cshtml @@ -1,5 +1,4 @@ @addTagHelper *, BundlerMinifier.TagHelpers -@using System.Globalization @model UpdatePointOfSaleViewModel @{ ViewData["Title"] = "Update Point of Sale"; @@ -132,6 +131,16 @@ +
+ + + +
+
+ + + +
@@ -265,6 +274,7 @@
- - + + + } diff --git a/BTCPayServer/Views/AppsPublic/ViewCrowdfund.cshtml b/BTCPayServer/Views/AppsPublic/ViewCrowdfund.cshtml index 558ebd373..03de8cb8c 100644 --- a/BTCPayServer/Views/AppsPublic/ViewCrowdfund.cshtml +++ b/BTCPayServer/Views/AppsPublic/ViewCrowdfund.cshtml @@ -32,9 +32,7 @@ @if (!string.IsNullOrEmpty(Model.EmbeddedCSS)) { - + @Safe.Raw($""); } diff --git a/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml b/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml index dede86e3c..4394c0894 100644 --- a/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml +++ b/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml @@ -42,11 +42,16 @@ grid-gap: .5rem; } - .card-deck .card:only-of-type { - max-width: 320px; - margin: auto; - } + .card-deck .card:only-of-type { + max-width: 320px; + margin: auto; + } + @if (!string.IsNullOrEmpty(Model.EmbeddedCSS)) + { + @Safe.Raw($""); + } + @@ -258,8 +263,13 @@ + @if (!string.IsNullOrEmpty(Model.Description)) + { +
+
@Safe.Raw(Model.Description)
+
+ } -
@@ -335,7 +345,12 @@

@Model.Title

- + @if (!string.IsNullOrEmpty(Model.Description)) + { +
+
@Safe.Raw(Model.Description)
+
+ }
@for (int x = 0; x < Model.Items.Length; x++) { diff --git a/BTCPayServer/bundleconfig.json b/BTCPayServer/bundleconfig.json index 153757d3e..28eec7957 100644 --- a/BTCPayServer/bundleconfig.json +++ b/BTCPayServer/bundleconfig.json @@ -116,6 +116,24 @@ "wwwroot/vendor/summernote/summernote-bs4.css" ] }, + { + "outputFileName": "wwwroot/bundles/pos-admin-bundle.min.js", + "inputFiles": [ + "wwwroot/vendor/highlightjs/highlight.min.js", + "wwwroot/vendor/summernote/summernote-bs4.js", + "wwwroot/pos-admin/main.js", + "wwwroot/products/js/products.js", + "wwwroot/products/js/products.jquery.js" + ] + }, + { + "outputFileName": "wwwroot/bundles/pos-admin-bundle.min.css", + "inputFiles": [ + "wwwroot/vendor/highlightjs/default.min.css", + "wwwroot/vendor/summernote/summernote-bs4.css" + ] + }, + { "outputFileName": "wwwroot/bundles/crowdfund-bundle.min.css", "inputFiles": [ diff --git a/BTCPayServer/wwwroot/pos-admin/main.js b/BTCPayServer/wwwroot/pos-admin/main.js new file mode 100644 index 000000000..956f5a7d4 --- /dev/null +++ b/BTCPayServer/wwwroot/pos-admin/main.js @@ -0,0 +1,7 @@ +hljs.initHighlightingOnLoad(); +$(document).ready(function () { + + $(".richtext").summernote({ + minHeight: 300 + }); +});