From efa567f96518fef2e5b3bc03e6fd0c029acfbc22 Mon Sep 17 00:00:00 2001 From: Umar Bolatov Date: Sat, 10 Apr 2021 18:38:57 -0700 Subject: [PATCH] Unify POS app card markup --- .../AppsPublic/PointOfSale/Static.cshtml | 74 +++++++++---------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/BTCPayServer/Views/AppsPublic/PointOfSale/Static.cshtml b/BTCPayServer/Views/AppsPublic/PointOfSale/Static.cshtml index 6bb47ce6b..83cbb5d69 100644 --- a/BTCPayServer/Views/AppsPublic/PointOfSale/Static.cshtml +++ b/BTCPayServer/Views/AppsPublic/PointOfSale/Static.cshtml @@ -19,7 +19,7 @@ @for (int x = 0; x < Model.Items.Length; x++) { var item = Model.Items[x]; - var buttonText = (string.IsNullOrEmpty(item.BuyButtonText) ? + var buttonText = (string.IsNullOrEmpty(item.BuyButtonText) ? item.Custom? Model.CustomButtonText : Model.ButtonText @@ -31,33 +31,15 @@ { Card image cap } -
-
@item.Title
- @if (!String.IsNullOrWhiteSpace(item.Description)) - { -

@Safe.Raw(item.Description)

- } -
+ @{CardBody(item.Title, item.Description);} - }else if (anyInventoryItems) + } + else if (anyInventoryItems) {
 
} @@ -93,22 +75,10 @@ @if (Model.ShowCustomAmount) {
-
-
Custom Amount
-

Create invoice to pay custom amount

- -
+ @{CardBody("Custom Amount", "Create invoice to pay custom amount");}
+ +@functions { + private void PayFormInputContent(string buttonText, decimal? minPriceValue = null, decimal? priceValue = null) + { +
+
+ @Model.CurrencySymbol +
+ +
+ +
+
+ } + + private void CardBody(string title, string description) + { +
+
@title
+ @if (!String.IsNullOrWhiteSpace(description)) + { +

@Safe.Raw(description)

+ } +
+ } +}