btcpayserver/BTCPayServer/Views/Invoice/Checkout.cshtml

156 lines
5.6 KiB
Plaintext
Raw Normal View History

@addTagHelper *, Meziantou.AspNetCore.BundleTagHelpers
2018-03-23 09:27:48 +01:00
@inject BTCPayServer.Services.LanguageService langService
@model PaymentModel
2017-09-13 08:47:34 +02:00
@{
Layout = null;
2017-09-13 08:47:34 +02:00
}
<!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">
2017-12-02 06:13:11 +01:00
<title>BTCPay Invoice</title>
2017-09-13 08:47:34 +02:00
<bundle name="wwwroot/bundles/checkout-bundle.min.css" />
<script type="text/javascript">
2018-05-03 18:46:52 +02:00
var srvModel = @Html.Raw(Json.Serialize(Model));
</script>
<bundle name="wwwroot/bundles/checkout-bundle.min.js" />
@if(Model.CustomCSSLink != null)
{
<link href="@Model.CustomCSSLink" rel="stylesheet" />
}
2017-09-13 08:47:34 +02:00
</head>
<body style="background: #E4E4E4">
<noscript>
<center style="padding: 2em">
<h2>Javascript is currently disabled in your browser.</h2>
<h5>Please enable Javascript and refresh this page for the best experience.</h5>
2017-09-13 08:47:34 +02:00
<p>Alternatively, click below to continue to our HTML-only invoice.</p>
2017-09-13 08:47:34 +02:00
<form action="/invoice-noscript" method="GET">
<button style="text-decoration: underline; color: blue">Continue to javascript-disabled invoice &gt;</button>
</form>
</center>
</noscript>
2017-09-13 08:47:34 +02:00
<!--[if lte IE 8]>
<center style="padding: 2em">
<form action="/invoice-noscript" method="GET">
<button style="text-decoration: underline; color: blue">Continue to legacy browser compatible invoice page
</button>
</form>
</center>
<![endif]-->
2017-09-13 08:47:34 +02:00
<invoice>
<div class="no-bounce" id="checkoutCtrl">
<div class="modal page">
2018-03-23 05:15:54 +01:00
<div class="modal-dialog open opened enter-purchaser-email" role="document">
<div class="modal-content long">
<div class="content">
<div class="invoice">
@Html.Partial("Checkout-Body")
</div>
</div>
</div>
<div style="margin-top: 10px; text-align: right;">
@* Not working because of nsSeparator: false, keySeparator: false,
{{$t("nested.lang")}} >>
*@
2018-03-23 05:16:38 +01:00
<select class="cmblang reverse invisible" onchange="changeLanguage($(this).val())">
2018-03-23 09:27:48 +01:00
@foreach(var lang in langService.GetLanguages())
{
<option value="@lang.Code">@lang.DisplayName</option>
}
</select>
<script>
$(function () {
2018-03-23 09:27:48 +01:00
var storeDefaultLang = '@Model.DefaultLang';
2018-03-23 05:02:53 +01:00
if (urlParams.lang) {
$(".cmblang").val(urlParams.lang);
2018-03-23 09:27:48 +01:00
} else if (storeDefaultLang) {
$(".cmblang").val(storeDefaultLang);
2018-03-23 05:02:53 +01:00
}
$('select').prettyDropdown({
classic: false,
height: 30,
reverse: true,
hoverIntent: 5000
});
});
</script>
</div>
2018-03-27 08:22:48 +02:00
<div style="margin-top: 10px; text-align: right;" class="form-text small text-muted">
<span>Powered by <a target="_blank" href="https://github.com/btcpayserver/btcpayserver">BTCPay Server</a></span>
</div>
</div>
</div>
</div>
</invoice>
<script type="text/javascript">
2018-03-23 09:27:48 +01:00
var storeDefaultLang = '@Model.DefaultLang';
// initialization
i18next.init({
2018-03-23 16:58:37 +01:00
lng: storeDefaultLang,
fallbackLng: 'en-US',
nsSeparator: false,
keySeparator: false,
resources: {
2018-03-23 16:58:37 +01:00
'en-US': { translation: locales_en },
'de-DE': { translation: locales_de },
2018-03-24 06:35:49 +01:00
'es-ES': { translation: locales_es },
2018-03-24 15:02:41 +01:00
'ja-JP': { translation: locales_ja },
2018-03-23 17:04:05 +01:00
'fr-FR': { translation: locales_fr },
2018-04-16 04:38:10 +02:00
'pt': { translation: locales_pt },
2018-03-23 17:10:19 +01:00
'pt-BR': { translation: locales_pt_br },
2018-03-25 17:17:38 +02:00
'nl': { translation: locales_nl },
2018-03-29 10:19:07 +02:00
'cs-CZ': { translation: locales_cs },
2018-04-29 17:29:34 +02:00
'is-IS': { translation: locales_is },
2018-04-28 18:13:44 +02:00
'hr-HR': { translation: locales_hr }
},
});
2018-03-23 05:16:38 +01:00
function changeLanguage(lang) {
i18next.changeLanguage(lang);
}
if (urlParams.lang) {
changeLanguage(urlParams.lang);
}
2018-03-23 09:27:48 +01:00
else if (storeDefaultLang) {
changeLanguage(storeDefaultLang);
}
2018-03-23 05:16:38 +01:00
const i18n = new VueI18next(i18next);
// TODO: Move all logic from core.js to Vue controller
Vue.config.ignoredElements = [
'line-items',
'low-fee-timeline',
// Ignoring custom HTML5 elements, eg: bp-spinner
/^bp-/
];
var checkoutCtrl = new Vue({
i18n: i18n,
el: '#checkoutCtrl',
components: {
qrcode: VueQr
},
data: {
2018-03-23 05:02:53 +01:00
srvModel: srvModel,
expiringSoon: false
}
});
</script>
2017-09-13 08:47:34 +02:00
</body>
</html>