From b4b69394983bf1ee0b5771ff91953a1d9056c15c Mon Sep 17 00:00:00 2001 From: rockstardev Date: Thu, 4 Apr 2019 21:48:52 -0500 Subject: [PATCH 1/2] Coin switching on no-script invoices --- .../Controllers/InvoiceController.UI.cs | 2 +- .../Views/Invoice/CheckoutNoScript.cshtml | 88 ++++++++++++------- 2 files changed, 58 insertions(+), 32 deletions(-) diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index 7e1a73256..9305fcab8 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -226,7 +226,7 @@ namespace BTCPayServer.Controllers if (model == null) return NotFound(); - return View(nameof(CheckoutNoScript), model); + return View(model); } diff --git a/BTCPayServer/Views/Invoice/CheckoutNoScript.cshtml b/BTCPayServer/Views/Invoice/CheckoutNoScript.cshtml index 3d74bcd69..6eddbd242 100644 --- a/BTCPayServer/Views/Invoice/CheckoutNoScript.cshtml +++ b/BTCPayServer/Views/Invoice/CheckoutNoScript.cshtml @@ -13,37 +13,63 @@ @Model.HtmlTitle -

Pay with @Model.StoreName

- @if (Model.Status == "new") - { -
-

To complete payment, please send @Model.BtcDue @Model.CryptoCode to @Model.BtcAddress

-

Time remaining: @Model.TimeLeft

-

@Model.InvoiceBitcoinUrl

-
- } - else if (Model.Status == "paid" || Model.Status == "complete" || Model.Status == "confirmed") - { -
-

This invoice has been paid

-
- } - else if (Model.Status == "expired" || Model.Status == "invalid") - { -
-

This invoice has expired

-
- } - else - { -
-

Non-supported state of invoice

-
- } +

Pay with @Model.StoreName

+ @if (Model.Status == "new") + { +
+

To complete payment, please send @Model.BtcDue @Model.CryptoCode to @Model.BtcAddress

+

Time remaining: @Model.TimeLeft

+

@Model.InvoiceBitcoinUrl

+ @if (Model.IsLightning) + { +

Peer Info: @Model.PeerInfo

+ } +
-
-

- Go back to Javascript enabled invoice -

+ @if (Model.AvailableCryptos.Count > 1) + { +
+
+

Pay with:

+ +
+ } + } + else if (Model.Status == "paid" || Model.Status == "complete" || Model.Status == "confirmed") + { +
+

This invoice has been paid

+
+ } + else if (Model.Status == "expired" || Model.Status == "invalid") + { +
+

This invoice has expired

+
+ } + else + { +
+

Non-supported state of invoice

+
+ } + +
+

+ Go back to Javascript enabled invoice +

From 58f138e854140603e6d5cd4b5a540d22caa57673 Mon Sep 17 00:00:00 2001 From: rockstardev Date: Thu, 4 Apr 2019 22:25:38 -0500 Subject: [PATCH 2/2] Invoice list improvements Items 5 and 9 from #349 --- .../Views/Invoice/ListInvoices.cshtml | 59 ++++++++++++++----- 1 file changed, 43 insertions(+), 16 deletions(-) diff --git a/BTCPayServer/Views/Invoice/ListInvoices.cshtml b/BTCPayServer/Views/Invoice/ListInvoices.cshtml index 47aed9225..e3238a89a 100644 --- a/BTCPayServer/Views/Invoice/ListInvoices.cshtml +++ b/BTCPayServer/Views/Invoice/ListInvoices.cshtml @@ -89,7 +89,7 @@ @foreach (var invoice in Model.Invoices) { - @invoice.Date.ToTimeAgo() + @invoice.Date.ToBrowserDate() @if (invoice.RedirectUrl != string.Empty) { @@ -142,29 +142,56 @@ -