From e7ea8ac40f5e364764dc927f904a19d076279c32 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Mon, 24 Aug 2020 06:57:07 +0200 Subject: [PATCH] Improve invoices list view (#1815) * Improve invoices list view * Pager: Only show options that make sense * ListInvoices formatting * Add separator for dropdown toggle split * Minor ListInvoices improvement * Improve payment requests list view * Distinguish empty and filtered lists * Properly align invoice details * Add payment symbols to invoices list * Improve payment symbols in invoices list * Always display search on list pages * Inline variable * Move display logic to pager https://github.com/btcpayserver/btcpayserver/commit/e5040ede5535f5691fd5a0358be2307fd9d4e1c7#commitcomment-41698272 --- BTCPayServer/Components/Pager/Default.cshtml | 57 +- .../Controllers/InvoiceController.UI.cs | 1 - .../Models/InvoicingModels/InvoicesModel.cs | 1 - .../Views/Invoice/ListInvoices.cshtml | 584 +++++++++--------- .../PaymentRequest/GetPaymentRequests.cshtml | 142 +++-- BTCPayServer/wwwroot/main/site.css | 5 + 6 files changed, 428 insertions(+), 362 deletions(-) diff --git a/BTCPayServer/Components/Pager/Default.cshtml b/BTCPayServer/Components/Pager/Default.cshtml index 2234f55cf..a9e0fc4c7 100644 --- a/BTCPayServer/Components/Pager/Default.cshtml +++ b/BTCPayServer/Components/Pager/Default.cshtml @@ -1,8 +1,8 @@ @model BasePagingViewModel - +} @{ string NavigatePages(int prevNext, int count) { diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index 2a8ae27da..4afb92f57 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -623,7 +623,6 @@ namespace BTCPayServer.Controllers model.Invoices.Add(new InvoiceModel() { Status = invoice.Status, - StatusString = state.ToString(), ShowCheckout = invoice.Status == InvoiceStatus.New, Date = invoice.InvoiceTime, InvoiceId = invoice.Id, diff --git a/BTCPayServer/Models/InvoicingModels/InvoicesModel.cs b/BTCPayServer/Models/InvoicingModels/InvoicesModel.cs index ef2d03fd2..1e109a706 100644 --- a/BTCPayServer/Models/InvoicingModels/InvoicesModel.cs +++ b/BTCPayServer/Models/InvoicingModels/InvoicesModel.cs @@ -19,7 +19,6 @@ namespace BTCPayServer.Models.InvoicingModels public string InvoiceId { get; set; } public InvoiceStatus Status { get; set; } - public string StatusString { get; set; } public bool CanMarkComplete { get; set; } public bool CanMarkInvalid { get; set; } public bool CanMarkStatus => CanMarkComplete || CanMarkInvalid; diff --git a/BTCPayServer/Views/Invoice/ListInvoices.cshtml b/BTCPayServer/Views/Invoice/ListInvoices.cshtml index 81bb2b967..cf6cf7815 100644 --- a/BTCPayServer/Views/Invoice/ListInvoices.cshtml +++ b/BTCPayServer/Views/Invoice/ListInvoices.cshtml @@ -1,322 +1,351 @@ +@using BTCPayServer.Payments @model InvoicesModel @{ ViewData["Title"] = "Invoices"; + var storeIds = string.Join("", Model.StoreIds.Select(storeId => $",storeid:{storeId}")); } @section HeadScripts { } - @Html.HiddenFor(a => a.Count)
@if (TempData.HasStatusMessage()) { -
-
- +
+
+ +
-
}

@ViewData["Title"]


-

Create, search or pay an invoice. (Help)

-
-

- You can search for invoice Id, deposit address, price, order id, store id, any buyer information and any product information.
- Be sure to split your search parameters with comma, for example: startdate:2019-04-25 13:00:00, status:paid
- You can also apply filters to your search by searching for filtername:value, here is a list of supported filters -

-
    -
  • storeid:id for filtering a specific store
  • -
  • orderid:id for filtering a specific order
  • -
  • itemcode:code for filtering a specific type of item purchased through the pos or crowdfund apps
  • -
  • status:(expired|invalid|complete|confirmed|paid|new) for filtering a specific status
  • -
  • exceptionstatus:(paidover|paidlate|paidpartial) for filtering a specific exception state
  • -
  • unusual:(true|false) for filtering invoices which might requires merchant attention (those invalid or with an exceptionstatus)
  • -
  • startdate:yyyy-MM-dd HH:mm:ss getting invoices that were created after certain date
  • -
  • enddate:yyyy-MM-dd HH:mm:ss getting invoices that were created before certain date
  • -
-

- If you want all confirmed and complete invoices, you can duplicate a filter status:confirmed, status:complete. -

-
+

Create, search or pay an invoice.

-
- -
- - -
- - - - @{ - var storeIds = string.Join( - "", - Model.StoreIds.Select(storeId => $",storeid:{storeId}") - ); - } - - -
+
+ - - - -
-
-
- Create a new invoice - - - -