btcpayserver/BTCPayServer/Views/Invoice/InvoiceStatusChangePartial.cshtml
Samuel Adams ec68d2a0e6
Remove Confirmed state in UI (#3090)
* Remove Confirmed state in UI

Closes #1789.

* Add infobox & improve refund tooltip

* Update BTCPayServer/Views/Invoice/ListInvoices.cshtml

Add @dennisreimann suggestion

Co-authored-by: d11n <mail@dennisreimann.de>

* Add "don't show again" button

Adds a "Don't Show Again" button to the infobox. Also a bugfix that was preventing the new status from showing in the invoice details page.

* Add User blob and move invoice status notice to it

Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: Kukks <evilkukka@gmail.com>
2021-11-26 23:13:41 +09:00

57 lines
3.4 KiB
Text

@inject UserManager<ApplicationUser> _userManager
@* This is a temporary infobox to inform users about the state changes in 1.4.0. It should be removed eventually. *@
@if ((await _userManager.GetUserAsync(User)).GetBlob().ShowInvoiceStatusChangeHint)
{
<div class="row">
<div class="alert alert-light alert-dismissible fade show" role="alert">
<form method="post" asp-controller="Manage" asp-action="DisableShowInvoiceStatusChangeHint" id="invoicestatuschangeform">
<h6><strong>Update v1.4.0:</strong> Invoice states have been updated to match the Greenfield API.</h6>
<div class="float-start">
<ul class="list-unstyled">
<li>
<span class="badge badge-processing">Paid</span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z"/>
</svg>
<span class="badge badge-processing">Processing</span>
</li>
<li>
<span class="badge badge-settled">Completed</span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z"/>
</svg>
<span class="badge badge-settled">Settled</span>
</li>
<li>
<span class="badge badge-settled">Confirmed</span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z"/>
</svg>
<span class="badge badge-settled">Settled</span>
</li>
</ul>
</div>
<div class="float-end">
<button type="button" class="btn btn-primary" data-bs-dismiss="alert">
Dismiss
</button>
<button name="command" type="submit" value="save" class="btn btn-danger" data-bs-dismiss="alert">
Don't Show Again
</button>
</div>
</form>
</div>
</div>
}
<script>
document.addEventListener("DOMContentLoaded", function () {
document.getElementById("invoicestatuschangeform").addEventListener("submit", function (event) {
event.preventDefault();
var xhttp = new XMLHttpRequest();
xhttp.open('POST', event.target.getAttribute('action'), true);
xhttp.send(new FormData(event.target));
});
});
</script>