40 lines
2.1 KiB
Plaintext
40 lines
2.1 KiB
Plaintext
{# The footer under the book list: what this device is running, and the one
|
|
button that makes it forget.
|
|
|
|
Both digests are stamped into sw.js by server.py from the files on disk:
|
|
shell covers assets/, the hand-written chrome, and library covers bible/,
|
|
the generated pages. They are the same two values the worker names its
|
|
caches after, so a device showing a digest is a device serving that cache.
|
|
|
|
It says what the worker that composed this document was, not what is
|
|
controlling right now. An update installs, claims and starts answering
|
|
without this document being rebuilt, so the value only becomes current on
|
|
the next full load -- which is the reload you would do to check it anyway.
|
|
|
|
version is null in one case: boot.html composed this page, so there was no
|
|
worker to ask. The line is then absent, which is the honest answer -- no
|
|
worker means no version, and the bookmark slot in the navbar is empty for
|
|
the same reason. The button stays, because a device with no worker and a
|
|
full cache is exactly the state worth clearing.
|
|
|
|
Rendered on every page and shown under the book list alone. Populating it
|
|
only for the index would look like the smaller change and would not work:
|
|
the shell is composed once per full navigation, and a boosted link to the
|
|
book list swaps #content without rebuilding anything around it. So the page
|
|
decides, not the composer -- app.js looks for the index in #content after
|
|
every swap. The body class this was rendered with cannot be asked, for the
|
|
same reason: it goes stale the moment a link is clicked.
|
|
|
|
The button is a plain <button> outside any form, which is the whole of why
|
|
hx-boost on <body> leaves it alone: htmx boosts links, forms, and submits
|
|
belonging to one. resetApp() in js/app.js is what it runs. #}
|
|
<div class="app-version d-none text-center mt-5 mb-2" id="app-version">
|
|
{%- if version %}
|
|
<p class="app-version-digests form-text mt-0 mb-2">
|
|
shell {{ version.shell }} · library {{ version.library }}
|
|
</p>
|
|
{%- endif %}
|
|
<button type="button" class="app-reset btn btn-outline-secondary btn-sm"
|
|
id="app-reset">Reset app</button>
|
|
</div>
|