2018-11-27 07:14:32 +01:00
|
|
|
@addTagHelper *, Meziantou.AspNetCore.BundleTagHelpers
|
|
|
|
@inject BTCPayServer.HostedServices.CssThemeManager themeManager
|
2018-05-07 17:19:28 +02:00
|
|
|
|
2018-08-30 20:16:24 +02:00
|
|
|
@model BTCPayServer.Models.AppViewModels.ViewPointOfSaleViewModel
|
2018-04-03 04:50:41 +02:00
|
|
|
@{
|
|
|
|
ViewData["Title"] = Model.Title;
|
|
|
|
Layout = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html class="h-100">
|
|
|
|
<head>
|
|
|
|
<title>@Model.Title</title>
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
2018-05-07 17:19:28 +02:00
|
|
|
<link href="@this.Context.Request.GetAbsoluteUri(themeManager.BootstrapUri)" rel="stylesheet" />
|
2018-11-17 03:39:43 +01:00
|
|
|
@if (Model.CustomCSSLink != null)
|
|
|
|
{
|
|
|
|
<link href="@Model.CustomCSSLink" rel="stylesheet" />
|
|
|
|
}
|
2018-11-27 07:14:32 +01:00
|
|
|
<link href="~/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
|
|
|
|
|
|
|
|
@if (Model.EnableShoppingCart)
|
|
|
|
{
|
|
|
|
<script type="text/javascript">
|
|
|
|
var srvModel = @Html.Raw(Json.Serialize(Model));
|
|
|
|
</script>
|
|
|
|
<bundle name="wwwroot/bundles/cart-bundle.min.js" />
|
|
|
|
}
|
2018-04-03 04:50:41 +02:00
|
|
|
</head>
|
|
|
|
<body class="h-100">
|
2018-11-27 07:14:32 +01:00
|
|
|
@if (Model.EnableShoppingCart)
|
|
|
|
{
|
|
|
|
<div id="cartModal" class="modal" tabindex="-1" role="dialog">
|
|
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<h5 class="modal-title">Shopping cart</h5>
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
|
|
<span aria-hidden="true">×</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<table id="js-cart-list" class="table mt-2 mb-3">
|
|
|
|
<thead class="thead-dark">
|
|
|
|
<tr>
|
|
|
|
<th colspan="2">Product</th>
|
|
|
|
<th class="text-right" width="80">Quantity</th>
|
|
|
|
<th class="text-right" width="25%">Price</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody></tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
|
|
<form method="post" asp-antiforgery="false" data-buy>
|
|
|
|
<input id="js-cart-amount" class="form-control" type="hidden" name="amount">
|
|
|
|
<button id="js-cart-pay" class="btn btn-primary" type="submit"><b>@Model.CustomButtonText</b></button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
|
2018-04-03 04:50:41 +02:00
|
|
|
<div class="container d-flex h-100">
|
2018-11-13 08:29:18 +01:00
|
|
|
<div class="justify-content-center align-self-center text-center mx-auto px-2 py-3 w-100" style="margin: auto;">
|
|
|
|
<h1 class="mb-4">@Model.Title</h1>
|
2018-11-27 07:14:32 +01:00
|
|
|
@if (Model.EnableShoppingCart)
|
|
|
|
{
|
|
|
|
<a id="js-cart" class="btn btn-warning text-white text-right" href="#" data-toggle="modal" data-target="#cartModal"><i class="fa fa-shopping-basket"></i> <span class="badge badge-light badge-pill"><span id="js-cart-items">0</span></span></a>
|
|
|
|
}
|
2018-11-16 04:31:38 +01:00
|
|
|
<div class="row">
|
|
|
|
@for (int i = 0; i < Model.Items.Length; i++)
|
|
|
|
{
|
|
|
|
var className = (Model.Items.Length - i) > (Model.Items.Length % 4) ? "col-sm-6 col-lg-3" : "col-md align-self-start";
|
|
|
|
var item = Model.Items[i];
|
|
|
|
var image = item.Image;
|
|
|
|
var description = item.Description;
|
|
|
|
<div class="@className my-3 px-2">
|
2018-11-27 07:14:32 +01:00
|
|
|
<div class="card" data-id="@i">
|
2018-11-16 04:31:38 +01:00
|
|
|
@if (!String.IsNullOrWhiteSpace(image))
|
|
|
|
{
|
|
|
|
<img class="card-img-top" src="@image" alt="Card image cap">
|
|
|
|
}
|
|
|
|
<div class="card-body">
|
|
|
|
<h5 class="card-title">@item.Title</h5>
|
|
|
|
@if (!String.IsNullOrWhiteSpace(description))
|
2018-11-10 07:38:26 +01:00
|
|
|
{
|
2018-11-16 04:31:38 +01:00
|
|
|
<p class="card-text">@description</p>
|
|
|
|
}
|
2018-11-27 07:14:32 +01:00
|
|
|
@if (item.Custom && !Model.EnableShoppingCart)
|
2018-11-16 04:31:38 +01:00
|
|
|
{
|
|
|
|
<form method="post" asp-antiforgery="false" data-buy>
|
2018-11-17 03:39:43 +01:00
|
|
|
<input type="hidden" name="choicekey" value="@item.Id" />
|
2018-11-16 04:31:38 +01:00
|
|
|
<div class="input-group">
|
|
|
|
<div class="input-group-prepend">
|
|
|
|
<span class="input-group-text">@Model.CurrencySymbol</span>
|
|
|
|
</div>
|
|
|
|
<input class="form-control" type="number" min="@item.Price.Value" step="@Model.Step" name="amount"
|
|
|
|
value="@item.Price.Value" placeholder="Amount">
|
|
|
|
<div class="input-group-append">
|
2018-11-17 03:39:43 +01:00
|
|
|
<button class="btn btn-primary" type="submit">@Model.CustomButtonText</button>
|
2018-11-16 04:31:38 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<form method="post" asp-antiforgery="false">
|
2018-11-27 07:14:32 +01:00
|
|
|
<button type="submit" name="choiceKey" class="js-add-cart btn btn-primary" value="@item.Id">
|
2018-11-17 03:39:43 +01:00
|
|
|
@String.Format(Model.ButtonText, @item.Price.Formatted)</button>
|
2018-11-16 04:31:38 +01:00
|
|
|
</form>
|
2018-11-10 07:38:26 +01:00
|
|
|
}
|
|
|
|
</div>
|
2018-04-03 04:50:41 +02:00
|
|
|
</div>
|
2018-11-16 04:31:38 +01:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
2018-09-28 06:31:59 +02:00
|
|
|
@if (Model.ShowCustomAmount)
|
2018-04-26 15:09:18 +02:00
|
|
|
{
|
2018-11-16 04:31:38 +01:00
|
|
|
<div class="row mt-2 mb-4">
|
|
|
|
<div class="col-lg-4 offset-lg-4 col-md-6 offset-md-3 px-2">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-body">
|
|
|
|
<h5 class="card-title">Custom Amount</h5>
|
|
|
|
<p class="card-text">Create invoice to pay custom amount</p>
|
|
|
|
<form method="post" asp-antiforgery="false" data-buy>
|
|
|
|
<div class="input-group">
|
|
|
|
<div class="input-group-prepend">
|
|
|
|
<span class="input-group-text">@Model.CurrencySymbol</span>
|
|
|
|
</div>
|
|
|
|
<input class="form-control" type="number" min="0" step="@Model.Step" name="amount" placeholder="Amount">
|
2018-11-17 03:39:43 +01:00
|
|
|
<div class="input-group-append"><button class="btn btn-primary" type="submit">@Model.CustomButtonText</button></div>
|
2018-11-16 04:31:38 +01:00
|
|
|
</div>
|
|
|
|
</form>
|
2018-04-03 04:50:41 +02:00
|
|
|
</div>
|
2018-11-16 04:31:38 +01:00
|
|
|
</div>
|
2018-04-03 04:50:41 +02:00
|
|
|
</div>
|
2018-04-26 15:09:18 +02:00
|
|
|
</div>
|
|
|
|
}
|
2018-04-03 04:50:41 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|