Templates working

This commit is contained in:
2023-03-09 20:46:01 +01:00
parent a55678e5ef
commit d514a639a9
13 changed files with 158 additions and 41 deletions

View File

@ -8,33 +8,29 @@
<title>@Model.Title</title>
<meta charset="UTF-8"/>
<script>
window.finished = false;
window.PagedConfig = { auto: navigator.webdriver };
window.PagedConfig = { auto: false };
if (!navigator.webdriver) {
window.addEventListener("beforeprint", async () => {
await window.PagedPolyfill.preview();
window.finished = true;
});
window.addEventListener("afterprint", () => {
location.reload();
});
window.addEventListener("beforeprint", async () => { await window.PagedPolyfill.preview(); });
window.addEventListener("afterprint", () => { location.reload(); });
}
</script>
<!-- TODO store paged.js locally to avoid using the internet -->
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
<link rel="stylesheet" href="style.css" type="text/css"/>
<style>
@{ await IncludeAsync("style.css"); }
</style>
</head>
<body>
<div class="m1"></div>
<div class="m2"></div>
<div class="m3"></div>
<header>@Model.Header</header>
<header>@Raw(Model.Header)</header>
<div class="footer-wrapper">
<div class="pre-footer">
<span class="date">@Model.FullDateString</span>
<span class="page"></span>
</div>
<footer>@Model.Footer</footer>
<footer>@Raw(Model.Footer)</footer>
</div>
<div class="spacing"></div>
<div class="main-wrapper">