This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/terms/theme.php
Shish f84bcaec01 microhtml for everything in <head>
I wanted to ensure that all pages (even the downtime page, terms page, home page, etc) had the appropriate `data-` attributes on `<body>` (because those are required for certain javascript, eg autocomplete, to work). One thing led to another and now everything in `head` is microhtml'ed
2024-06-21 18:52:05 +01:00

25 lines
628 B
PHP

<?php
declare(strict_types=1);
namespace Shimmie2;
use function MicroHTML\{emptyHTML, TITLE, META, rawHTML};
class TermsTheme extends Themelet
{
public function display_page(Page $page, string $sitename, string $path, string $body): void
{
$html =
"<div id='terms-modal-bg'>
<dialog id='terms-modal' class='setupblock' open>
<h1><span>$sitename</span></h1>
$body
<form action='/accept_terms/$path' method='POST'>
<button class='terms-modal-enter' autofocus>Enter</button>
</form>
</dialog>
</div>";
$page->add_block(new Block(null, $html, "main", 1));
}
}