btcpayserver/BTCPayServer/Views/Invoice/CheckoutNoScript.cshtml
Dennis Reimann 8420c74b31
Improve static asset caching
Cache static assets for one year and set the correct cache control header. Adds the cache busting version based on file content to asset references to invalidate the cache on change. ([further details on the approach](https://andrewlock.net/adding-cache-control-headers-to-static-files-in-asp-net-core/) and [why one year](https://ashton.codes/set-cache-control-max-age-1-year/))

Most of the changes are the additions of the `asp-append-version="true"` attribute, the main configuration change is in `Startup.cs`.
2020-04-18 17:56:05 +02:00

73 lines
2.4 KiB
Text

@model PaymentModel
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<META NAME="robots" CONTENT="noindex,nofollow">
<title>@Model.HtmlTitle</title>
</head>
<body>
<h1>Pay with @Model.StoreName</h1>
@if (Model.Status == "new")
{
if (!string.IsNullOrEmpty(Model.UISettings?.NoScriptPartialName))
{
<partial model="@Model" name="@Model.UISettings.NoScriptPartialName"/>
}
else
{
<h1 class="text-danger">This payment method requires javascript.</h1>
}
@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;" asp-append-version="true" /></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")
{
<div>
<p>This invoice has been paid</p>
</div>
}
else if (Model.Status == "expired" || Model.Status == "invalid")
{
<div>
<p>This invoice has expired</p>
</div>
}
else
{
<div>
<p>Non-supported state of invoice</p>
</div>
}
<hr />
<p>
<a href="/i/@Model.InvoiceId">Go back to Javascript enabled invoice</a>
</p>
</body>
</html>