b0bf6fe770
Guild membership is now the whole gate: discordCallback checks membership
(and DISCORD_REQUIRED_ROLE when set), then Store.EnsureReader creates the
Reader on first sight and returns the same row on every later login. The
refusal returns before EnsureReader, so nothing is created as a side
effect of being turned away. OWNER_DISCORD_ID keeps seeding the owner, but
only as the administrator — it no longer gates sign-in.
The cutover grace path is gone with it: API_TOKEN, API_TOKEN_GRACE_UNTIL
and the legacy branch in httpmw.ResolveReader are deleted, so a credential
authenticates exactly one Reader or nothing. That also lets
userscript.Handler drop the re-derivation — the resolved path segment is
already the credential to substitute.
New surfaces: an empty library offers both install links instead of
describing a filter (listView.Fresh, which also hides the action key it has
nothing to name), and the owner alone gets a Readers panel with
POST /readers/{id}/revoke (404 for anyone else) to sign a Reader out
everywhere.
Isolation is asserted from both directions rather than by counting one
Reader's rows, and the shared-series invariant is pinned: two Readers on
one series produce one series row, two independent progresses, one poll
per due cycle, and one Reader's delete leaves the other's bookmark and the
poll intact.
35 lines
1.9 KiB
HTML
35 lines
1.9 KiB
HTML
{{define "list"}}
|
|
{{if .Items}}
|
|
{{range .Items}}{{template "card" .}}{{end}}
|
|
{{/* The client filter only hides cards, so without this the list area goes
|
|
blank on a query that matches nothing. filter.js fills in the query and
|
|
unhides it; it lives inside #list so a tab swap re-creates it. */}}
|
|
<div class="empty" id="no-match" hidden>
|
|
<strong>No titles match “<span class="no-match-q"></span>”.</strong>
|
|
<button type="button" class="clear-search">Clear search</button>
|
|
</div>
|
|
{{else if .Fresh}}
|
|
{{/* Nothing anywhere, not an empty bucket: this Reader has just registered,
|
|
so the empty state is the setup instruction rather than a filter
|
|
report. Both scripts, because the two libraries are separate installs. */}}
|
|
<div class="empty">
|
|
<strong>Your library is empty.</strong>
|
|
<p>Install both userscripts, then open a series and read a chapter — bookmarks arrive on their own.</p>
|
|
<p class="setup-links">
|
|
<a class="ghost" href="/install/manga-bookmark.user.js">Install Manga script</a>
|
|
<a class="ghost" href="/install/novel-bookmark.user.js">Install Novels script</a>
|
|
</p>
|
|
</div>
|
|
{{else if eq .Tab "fav"}}
|
|
<div class="empty"><strong>No favourites yet.</strong><p>Star a series to pin it here.</p></div>
|
|
{{else if eq .Tab "new"}}
|
|
<div class="empty"><strong>Nothing new.</strong><p>Every series is caught up to its latest chapter.</p></div>
|
|
{{else if eq .Tab "archived"}}
|
|
<div class="empty"><strong>Nothing archived.</strong><p>Shelve a series to park it here — it keeps getting checked for new chapters.</p></div>
|
|
{{else if eq .Tab "finished"}}
|
|
<div class="empty"><strong>Nothing finished yet.</strong><p>Mark a series finished and it moves out of your reading list.</p></div>
|
|
{{else}}
|
|
<div class="empty"><strong>Nothing here yet.</strong><p>Bookmarks appear once the userscript records a chapter.</p></div>
|
|
{{end}}
|
|
{{end}}
|