Merge pull request #737 from rockstardev/uifixes

New batch of UI fixes
This commit is contained in:
Nicolas Dorier 2019-04-05 15:23:41 +09:00 committed by GitHub
commit 2741187546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 101 additions and 48 deletions

View File

@ -226,7 +226,7 @@ namespace BTCPayServer.Controllers
if (model == null)
return NotFound();
return View(nameof(CheckoutNoScript), model);
return View(model);
}

View File

@ -17,10 +17,36 @@
@if (Model.Status == "new")
{
<div>
<p>To complete payment, please send <b>@Model.BtcDue @Model.CryptoCode</b> to <b>@Model.BtcAddress</b></p>
<p>To complete payment, please send <b>@Model.BtcDue @Model.CryptoCode</b> to <b style="word-break: break-word;">@Model.BtcAddress</b></p>
<p>Time remaining: @Model.TimeLeft</p>
<p><a href="@Model.InvoiceBitcoinUrl">@Model.InvoiceBitcoinUrl</a></p>
<p><a href="@Model.InvoiceBitcoinUrl" style="word-break: break-word;">@Model.InvoiceBitcoinUrl</a></p>
@if (Model.IsLightning)
{
<p>Peer Info: <b>@Model.PeerInfo</b></p>
}
</div>
@if (Model.AvailableCryptos.Count > 1)
{
<div>
<hr />
<h2>Pay with:</h2>
<ul style="list-style-type: none;padding-left: 5px;">
@foreach (var crypto in Model.AvailableCryptos)
{
<li style="height: 32px; line-height: 32px;">
<a href="/invoice-noscript?id=@Model.InvoiceId&paymentMethodId=@crypto.PaymentMethodId">
<img alt="@crypto.PaymentMethodName" src="@crypto.CryptoImage" style="vertical-align:middle; height:24px; text-decoration:none; margin-top: -3px;" /></a>
<a href="/invoice-noscript?id=@Model.InvoiceId&paymentMethodId=@crypto.PaymentMethodId" style="padding-top: 2px;">
@crypto.PaymentMethodName
@(crypto.IsLightning ? Html.Raw("&#9889;") : null)
(@crypto.CryptoCode)
</a>
</li>
}
</ul>
</div>
}
}
else if (Model.Status == "paid" || Model.Status == "complete" || Model.Status == "confirmed")
{

View File

@ -89,7 +89,7 @@
@foreach (var invoice in Model.Invoices)
{
<tr>
<td>@invoice.Date.ToTimeAgo()</td>
<td>@invoice.Date.ToBrowserDate()</td>
<td>
@if (invoice.RedirectUrl != string.Empty)
{
@ -142,29 +142,56 @@
</tbody>
</table>
<nav aria-label="...">
<ul class="pagination">
<nav aria-label="..." class="w-100">
<ul class="pagination float-left">
<li class="page-item @(Model.Skip == 0 ? "disabled" : null)">
<a class="page-link" tabindex="-1" href="@Url.Action("ListInvoices", new
{
searchTerm = Model.SearchTerm,
skip = Math.Max(0, Model.Skip - Model.Count),
count = Model.Count,
})">Previous</a>
<a class="page-link" tabindex="-1" href="@listInvoices(-1, Model.Count)">&laquo;</a>
</li>
<li class="page-item disabled">
<span class="page-link">@(Model.Skip + 1) to @(Model.Skip + Model.Invoices.Count) of @Model.Total</span>
</li>
<li class="page-item @(Model.Total > (Model.Skip + Model.Invoices.Count) ? null : "disabled")">
<a class="page-link" href="@Url.Action("ListInvoices", new
{
searchTerm = Model.SearchTerm,
skip = Model.Skip + Model.Count,
count = Model.Count,
})">Next</a>
<a class="page-link" href="@listInvoices(1, Model.Count)">&raquo;</a>
</li>
</ul>
<ul class="pagination float-right">
<li class="page-item disabled">
<span class="page-link">Page Size:</span>
</li>
<li class="page-item @(Model.Count == 50 ? "active" : null)">
<a class="page-link" href="@listInvoices(0, 50)">50</a>
</li>
<li class="page-item @(Model.Count == 100 ? "active" : null)">
<a class="page-link" href="@listInvoices(0, 100)">100</a>
</li>
<li class="page-item @(Model.Count == 250 ? "active" : null)">
<a class="page-link" href="@listInvoices(0, 250)">250</a>
</li>
<li class="page-item @(Model.Count == 500 ? "active" : null)">
<a class="page-link" href="@listInvoices(0, 500)">500</a>
</li>
</ul>
</nav>
@{
string listInvoices(int prevNext, int count)
{
var skip = Model.Skip;
if (prevNext == -1)
skip = Math.Max(0, Model.Skip - Model.Count);
else if (prevNext == 1)
skip = Model.Skip + count;
var act = Url.Action("ListInvoices", new
{
searchTerm = Model.SearchTerm,
skip = skip,
count = count,
});
return act;
}
}
</div>