btcpayserver/BTCPayServer/Views/Shared/PointOfSale/Public/_Layout.cshtml
d11n 845e2881fa
POS Cart redesign (#5171)
* Move POS assets

* WIP

* Refactor into common Vue mixin

* Offcanvas updates

* Unifications across POS views

* POSData view fix

* Number and test fixes

* Update cart width

* Fix test

* More view unification

* Hide cart when emptied

* Validate cart

* Header improvement

* Increase remove icon size

* Animate add to cart action

* Offcanvas for mobile, sidebar for desktop

* ui+pos: updates icon size + badge + label

* Remove cart table headers

* Use same size for Cart and Shop headlines

* Update search placeholder

* Bump horizontal  input padding

* Increase sidebar width

* Bump badge font size

* Fix manipulating the quantity of line items

* Fix cart icon

* Update cart display

* updates empty button

* Rounded search input

* Remove cart button on desktop

* Fix dark accent color

* More accent fixes

* Fix plus/minus alignment

* Update BTCPayServer/Views/Shared/PointOfSale/Public/Cart.cshtml

* Apply suggestions from code review

---------

Co-authored-by: dstrukt <gfxdsign@gmail.com>
2023-07-22 21:15:41 +09:00

50 lines
2 KiB
Text

@using BTCPayServer.Abstractions.Extensions
@using Microsoft.AspNetCore.Hosting
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using Newtonsoft.Json.Linq
@using System.IO
@using BTCPayServer.Services
@inject IWebHostEnvironment WebHostEnvironment
@inject 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()))">
<link href="~/pos/common.css" asp-append-version="true" rel="stylesheet" />
@await RenderSectionAsync("PageHeadContent", false)
</head>
<body class="min-vh-100">
@RenderBody()
<partial name="LayoutFoot"/>
@await RenderSectionAsync("PageFootContent", false)
</body>
</html>