Simple Invoice Detail View Cleanup (#3100)

* changes copy to "unarchive", more clear

* adds semibold custom class

* adds class to TH elements & uppercases labels

* whitespace and padding patches

* uppercase patches

* removes class in site.css + updates class name

* Fix test

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
This commit is contained in:
dstrukt 2021-11-21 20:57:20 -08:00 committed by GitHub
parent 6ff659fb99
commit ead0f284f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 76 additions and 78 deletions

View File

@ -411,7 +411,7 @@ namespace BTCPayServer.Tests
//let's test archiving an invoice
Assert.DoesNotContain("Archived", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text);
s.Driver.FindElement(By.Id("btn-archive-toggle")).Click();
Assert.Contains("Archived", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text);
Assert.Contains("Unarchive", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text);
//check that it no longer appears in list
s.GoToInvoices();
@ -420,7 +420,7 @@ namespace BTCPayServer.Tests
s.Driver.Navigate().GoToUrl(invoiceUrl);
s.Driver.FindElement(By.Id("btn-archive-toggle")).Click();
s.FindAlertMessage();
Assert.DoesNotContain("Archived", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text);
Assert.DoesNotContain("Unarchive", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text);
s.GoToInvoices();
Assert.Contains(invoiceId, s.Driver.PageSource);

View File

@ -46,8 +46,7 @@
<section class="invoice-details">
<div class="container">
<partial name="_StatusMessage" />
<div class="row mb-4">
<div class="row mb-5">
<h2 class="col-xs-12 col-lg-6 mb-4 mb-lg-0">@ViewData["Title"]</h2>
<div class="col-xs-12 col-lg-6 mb-2 mb-lg-0 text-lg-end">
<div class="d-inline-flex">
@ -58,24 +57,23 @@
Checkout
</a>
}
@if (Model.CanRefund)
{
<a id="refundlink" class="btn btn-success text-nowrap ms-2" asp-action="Refund" asp-route-invoiceId="@Context.GetRouteValue("invoiceId")"><span class="fa fa-undo"></span> Issue refund</a>
<a id="refundlink" class="btn btn-success text-nowrap" asp-action="Refund" asp-route-invoiceId="@Context.GetRouteValue("invoiceId")"><span class="fa fa-undo"></span> Issue Refund</a>
}
else
{
<button href="#" class="btn btn-secondary text-nowrap ms-2" data-bs-toggle="tooltip" title="You can only issue refunds on invoices with confirmed payments" disabled><span class="fa fa-undo"></span> Issue refund</button>
<button href="#" class="btn btn-secondary text-nowrap" data-bs-toggle="tooltip" title="You can only issue refunds on invoices with confirmed payments" disabled><span class="fa fa-undo me-1"></span> Issue Refund</button>
}
<form class="p-0 ms-2" asp-action="ToggleArchive" asp-route-invoiceId="@Model.Id" method="post">
<form class="p-0 ms-3" asp-action="ToggleArchive" asp-route-invoiceId="@Model.Id" method="post">
<button type="submit" class="btn @(Model.Archived ? "btn-warning" : "btn btn-danger")" id="btn-archive-toggle">
@if (Model.Archived)
{
<span class="text-nowrap" data-bs-toggle="tooltip" title="Unarchive this invoice"><i class="ms-1 fa fa-close"></i> Archived</span>
<span class="text-nowrap" data-bs-toggle="tooltip" title="Unarchive this invoice">Unarchive</span>
}
else
{
<span class="text-nowrap" data-bs-toggle="tooltip" title="Archive this invoice so that it does not appear in the invoice list by default"><i class="ms-1 fa fa-archive"></i> Archive</span>
<span class="text-nowrap" data-bs-toggle="tooltip" title="Archive this invoice so that it does not appear in the invoice list by default"><i class="fa fa-archive me-1"></i> Archive</span>
}
</button>
</form>
@ -83,20 +81,20 @@
</div>
</div>
<div class="row">
<div class="col-md-6 mb-4">
<div class="row justify-content-between">
<div class="col-md-5">
<h3 class="mb-3">Invoice Information</h3>
<table class="table table-responsive-md">
<table class="table table-responsive-md mb-5">
<tr>
<th>Store</th>
<th class="fw-semibold">Store</th>
<td><a href="@Model.StoreLink" rel="noreferrer noopener">@Model.StoreName</a></td>
</tr>
<tr>
<th>Invoice Id</th>
<th class="fw-semibold">Invoice Id</th>
<td>@Model.Id</td>
</tr>
<tr>
<th>Order Id</th>
<th class="fw-semibold">Order Id</th>
<td>
@if (string.IsNullOrEmpty(Model.TypedMetadata.OrderUrl))
{
@ -118,11 +116,11 @@
</td>
</tr>
<tr>
<th>Payment Request Id</th>
<th class="fw-semibold">Payment Request Id</th>
<td><a href="@Model.PaymentRequestLink" rel="noreferrer noopener">@Model.TypedMetadata.PaymentRequestId</a></td>
</tr>
<tr>
<th>State</th>
<th class="fw-semibold">State</th>
<td>
@if (Model.CanMarkStatus)
{
@ -145,132 +143,133 @@
}
</div>
</div>
}
else {
}
else
{
@Model.State
}
</td>
</tr>
<tr>
<th>Created date</th>
<th class="fw-semibold">Created Date</th>
<td>@Model.CreatedDate.ToBrowserDate()</td>
</tr>
<tr>
<th>Expiration date</th>
<th class="fw-semibold">Expiration Date</th>
<td>@Model.ExpirationDate.ToBrowserDate()</td>
</tr>
<tr>
<th>Monitoring date</th>
<th class="fw-semibold">Monitoring Date</th>
<td>@Model.MonitoringDate.ToBrowserDate()</td>
</tr>
<tr>
<th>Transaction speed</th>
<th class="fw-semibold">Transaction Speed</th>
<td>@Model.TransactionSpeed</td>
</tr>
<tr>
<th>Total fiat due</th>
<th class="fw-semibold">Total Fiat Due</th>
<td>@Model.Fiat</td>
</tr>
@if (!string.IsNullOrEmpty(Model.RefundEmail))
{
<tr>
<th>Refund email</th>
<th class="fw-semibold">Refund Email</th>
<td><a href="mailto:@Model.RefundEmail">@Model.RefundEmail</a></td>
</tr>
}
@if (!string.IsNullOrEmpty(Model.NotificationUrl))
{
<tr>
<th>Notification Url</th>
<th class="fw-semibold">Notification Url</th>
<td>@Model.NotificationUrl</td>
</tr>
}
@if (!string.IsNullOrEmpty(Model.RedirectUrl))
{
<tr>
<th>Redirect Url</th>
<th class="fw-semibold">Redirect Url</th>
<td><a href="@Model.RedirectUrl" rel="noreferrer noopener">@Model.RedirectUrl</a></td>
</tr>
}
</table>
</div>
<div class="col-md-6 mb-4">
<h3 class="mb-3">Buyer Information</h3>
<table class="table table-responsive-md">
<tr>
<th>Name</th>
<td>@Model.TypedMetadata.BuyerName</td>
</tr>
<tr>
<th>Email</th>
<td><a href="mailto:@Model.TypedMetadata.BuyerEmail">@Model.TypedMetadata.BuyerEmail</a></td>
</tr>
<tr>
<th>Phone</th>
<td>@Model.TypedMetadata.BuyerPhone</td>
</tr>
<tr>
<th>Address 1</th>
<td>@Model.TypedMetadata.BuyerAddress1</td>
</tr>
<tr>
<th>Address 2</th>
<td>@Model.TypedMetadata.BuyerAddress2</td>
</tr>
<tr>
<th>City</th>
<td>@Model.TypedMetadata.BuyerCity</td>
</tr>
<tr>
<th>State</th>
<td>@Model.TypedMetadata.BuyerState</td>
</tr>
<tr>
<th>Country</th>
<td>@Model.TypedMetadata.BuyerCountry</td>
</tr>
<tr>
<th>Zip</th>
<td>@Model.TypedMetadata.BuyerZip</td>
</tr>
</table>
@if (Model.PosData.Count == 0)
{
<h3 class="mb-3">Product Information</h3>
<table class="table table-responsive-md">
<table class="table table-responsive-md mb-5">
@if (!string.IsNullOrEmpty(Model.TypedMetadata.ItemCode))
{
<tr>
<th>Item code</th>
<th class="fw-semibold">Item code</th>
<td>@Model.TypedMetadata.ItemCode</td>
</tr>
}
@if (!string.IsNullOrEmpty(Model.TypedMetadata.ItemDesc))
{
<tr>
<th>Item Description</th>
<th class="fw-semibold">Item Description</th>
<td>@Model.TypedMetadata.ItemDesc</td>
</tr>
}
<tr>
<th>Price</th>
<th class="fw-semibold">Price</th>
<td>@Model.Fiat</td>
</tr>
<tr>
<th>Tax included</th>
<th class="fw-semibold">Tax Included</th>
<td>@Model.TaxIncluded</td>
</tr>
</table>
}
</div>
<div class="col-md-5">
<h3 class="mb-3">Buyer Information</h3>
<table class="table table-responsive-md mb-5">
<tr>
<th class="fw-semibold">Name</th>
<td>@Model.TypedMetadata.BuyerName</td>
</tr>
<tr>
<th class="fw-semibold">Email</th>
<td><a href="mailto:@Model.TypedMetadata.BuyerEmail">@Model.TypedMetadata.BuyerEmail</a></td>
</tr>
<tr>
<th class="fw-semibold">Phone</th>
<td>@Model.TypedMetadata.BuyerPhone</td>
</tr>
<tr>
<th class="fw-semibold">Address 1</th>
<td>@Model.TypedMetadata.BuyerAddress1</td>
</tr>
<tr>
<th class="fw-semibold">Address 2</th>
<td>@Model.TypedMetadata.BuyerAddress2</td>
</tr>
<tr>
<th class="fw-semibold">City</th>
<td>@Model.TypedMetadata.BuyerCity</td>
</tr>
<tr>
<th class="fw-semibold">State</th>
<td>@Model.TypedMetadata.BuyerState</td>
</tr>
<tr>
<th class="fw-semibold">Country</th>
<td>@Model.TypedMetadata.BuyerCountry</td>
</tr>
<tr>
<th class="fw-semibold">Zip</th>
<td>@Model.TypedMetadata.BuyerZip</td>
</tr>
</table>
</div>
</div>
@if (Model.PosData.Count != 0)
{
<div class="row">
<div class="col-md-6 mb-4">
<div class="col-md-6">
<h3 class="mb-3">Product information</h3>
<table class="table table-responsive-md">
<table class="table table-responsive-md mb-5">
@if (!string.IsNullOrEmpty(Model.TypedMetadata.ItemCode))
{
<tr>
@ -362,7 +361,6 @@
}
</ul>
}
<div class="row">
<div class="col-md-12">
<h3 class="mb-0">Events</h3>
@ -386,4 +384,4 @@
</div>
</div>
</div>
</section>
</section>