mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-24 14:50:50 +01:00
* UI updates * Updates modes and calculation * Unify tip buttons * White caret * Add top margin to calculation * Add space between mode buttons and keypad * Discount updates
65 lines
2.3 KiB
Text
65 lines
2.3 KiB
Text
@using BTCPayServer.Abstractions.Extensions
|
|
@using Microsoft.AspNetCore.Hosting
|
|
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
|
@using Newtonsoft.Json.Linq
|
|
@using System.IO
|
|
@inject IWebHostEnvironment WebHostEnvironment
|
|
@inject BTCPayServer.Services.BTCPayServerEnvironment Env
|
|
@model BTCPayServer.Plugins.PointOfSale.Models.ViewPointOfSaleViewModel
|
|
@{
|
|
ViewData["Title"] = string.IsNullOrEmpty(Model.Title) ? Model.StoreName : Model.Title;
|
|
Layout = null;
|
|
|
|
async Task<string> GetDynamicManifest(string title)
|
|
{
|
|
var manifest = WebHostEnvironment.WebRootFileProvider.GetFileInfo("manifest.json");
|
|
if (!manifest.Exists)
|
|
{
|
|
return null;
|
|
}
|
|
using var reader = new StreamReader(manifest.CreateReadStream());
|
|
var jObject = JObject.Parse(await reader.ReadToEndAsync());
|
|
jObject["short_name"] = title;
|
|
jObject["name"] = $"BTCPay Server: {title}";
|
|
foreach (var jToken in jObject["icons"]!)
|
|
{
|
|
var icon = (JObject)jToken;
|
|
icon["src"] = $"{Context.Request.GetAbsoluteRoot()}/{icon["src"]}";
|
|
}
|
|
return $"data:application/manifest+json,{Safe.Json(jObject)}";
|
|
}
|
|
}
|
|
<!DOCTYPE html>
|
|
<html class="h-100" lang="en" @(Env.IsDeveloping ? " data-devenv" : "")>
|
|
<head>
|
|
<partial name="LayoutHead"/>
|
|
<partial name="LayoutHeadStoreBranding" model="@(Model.BrandColor, Model.CssFileId, Model.CustomCSSLink, Model.EmbeddedCSS)" />
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<link rel="apple-touch-icon" href="~/img/icons/icon-512x512.png">
|
|
<link rel="apple-touch-startup-image" href="~/img/splash.png">
|
|
<link rel="manifest" href="@(await GetDynamicManifest(ViewData["Title"]!.ToString()))">
|
|
<style>
|
|
.lead :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
.card-deck {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
grid-gap: 1.5rem;
|
|
}
|
|
.card {
|
|
page-break-inside: avoid;
|
|
}
|
|
.card:only-of-type {
|
|
max-width: 320px;
|
|
margin: auto !important;
|
|
}
|
|
</style>
|
|
@await RenderSectionAsync("PageHeadContent", false)
|
|
</head>
|
|
<body class="min-vh-100">
|
|
@RenderBody()
|
|
<partial name="LayoutFoot"/>
|
|
@await RenderSectionAsync("PageFootContent", false)
|
|
</body>
|
|
</html>
|