c3a7d8fb89
3 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e52c1e4d49
|
A byline, a way in, and the cell that was not a cell
Three things from a round of looking at the deployed site. **The staggered table rows.** content_list.html had `<td class="actions actions--row">`, and `.actions` is display:flex. A <td> told to be a flex container stops being a table cell: it leaves the row's layout and draws its bottom border at its own content height, so the columns' rules no longer meet. Nothing errors and the page renders, which is how it survived two rounds of somebody looking straight at it — including mine, when I blamed the wrapping on the Miembros table and rebuilt that page as cards. The flex row moves into a <div> inside the cell, and test_templates.py now fails on any <td> carrying the class, beside the guards for the things the CSP silently drops. **A published post did not say who wrote it.** The commit has named the author since the editor was built; the page never did, so a reader could not tell whose article it was. frontmatter_for writes `author`, and `author_url` only when that member has published their own page — a byline linking to a 404 is worse than one that does not link. publish() fills it from whoever wrote the thing, which for an approved proposal is the member and not the moderator; edit() deliberately does not, so fixing a typo in somebody's article never re-signs it. The hidden field carrying the URL back is checked against a path on this site, because a hidden field is a convention and not a promise. scripts/translate.py needed no change, which I checked rather than assumed: it copies the whole frontmatter and translates only the title and description, so an author reaches the German and Portuguese siblings untranslated, as a name should. The theme's single.html renders it, verified by building the site with Hugo 0.135 — `por <a href="/salvador">Salvador Dalí</a>` with the link, `por Salvador Dalí` without. **Contenido had no way in.** The page worked and nothing linked to it: Gestión offered only the static pages, and the Artículos tab exists only once you are already on that screen — so a moderator, who cannot open Gestión at all, had no route to the published articles. Gestión gains an Artículos card, Publicaciones gains *Ya publicado* beside its button, and the button that read "Nuevo página" now reads "Nueva página", since Spanish gives the article a gender and "Nuevo " + the singular cannot be right for both. 439 tests pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn |
||
|
|
28dd23e444
|
Publishing has never worked: one line, two wrong answers
gitea.py answered a 401 or 403 from the git server by raising
PermissionError("gitea-unauthorised"), with a comment saying the caller would
refresh and retry. That caller was tokens.py, deleted two phases ago when the
members area took over its own logins. Nothing has caught it since, so a
refused token arrived as a 500 on Contenido — Flask's own page, in English,
saying nothing — and, when approving a submission, as "no se encontró la imagen
en el disco", because PermissionError is a subclass of OSError and the approve
path caught OSError to mean a missing file. The page was displaying the
photograph two lines above the message.
Underneath both: a site-admin token cannot write to a repository. Gitea's
scopes are per category and `admin` does not contain `repository`, so the
editor has never been able to commit and nothing written in the members area
has ever reached the site. server-setup.md said the fallback to
GITEA_ADMIN_TOKEN "keeps an existing install working", which was the sentence
that hid it; it now says what that token can and cannot do.
Fixed: 401/403 raises a GiteaError naming the scope to check; approve reads the
picture before the try and catches only FileNotFoundError, so "the image is
missing" is said only when it is; and a 500 handler renders the site's own page
and logs the traceback with the request path.
Then the three wall pieces:
Every name — wall, thread, comment, private message, dashboard, directory —
renders through templates/_person.html, which links to vienalatina.com/<login>
only when that person has published a page. Both failure modes are silent, so
the rule lives in one macro instead of nine templates. A profile also has one
canonical address now: /<name>/ redirects to /<name>, which is what url_for had
been quietly preferring.
One 👍 per member per thread or comment, clicking again takes it back. The
table is shaped like attachments — two nullable parents, a CHECK that exactly
one is set — and uniqueness is two partial indexes, because UNIQUE across a
NULL column would make every comment reaction unique by accident. The `back`
field goes through auth.safe_next (renamed from _safe_next), since a redirect
somebody can type is an open redirect.
Miembros is a directory: a card per person with photo, username, role, the
first line of their bio, somewhere to write from and a link to their page.
Admin controls fold into a per-card Gestionar block. That is also the fix for
the misaligned row in the screenshot — four forms in a column two inches wide
was the cause, and the table is gone. Photos inside the members area are served
by a login-gated route even when the public page is unpublished, and the
profile form now says so.
404 tests pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
|
||
|
|
5ea6b1ac98
|
One dashboard, five sections, and a moderation queue
The members area had grown one navigation entry per phase, and three of the five were inside an admin-only block in base.html — so an ordinary member signed in to a wall and a member list, with their own profile, their own private messages and the content editor all invisible. Everything worked and nothing was reachable. That is the bug this starts from. The navigation is now Inicio · Muro · Privados · Publicaciones, plus Gestión for admins, and the account items (Mi perfil, Descargar mis datos, Salir) moved to a menu under the member's own name — a <details> element, because the CSP has no 'unsafe-inline' and a menu needing onclick="" silently never opens. Inicio is a new dashboard; the wall moved from /comunidad/ to /comunidad/muro and kept its thread URLs. test_navigation.py asserts the navigation per role from the rendered page, so this cannot come back quietly. Public posts are now curated. A member proposes one and it waits in a new `submissions` table; a moderator or admin approves it — which commits it through content.publish, the same function the editor uses, with the author named per commit so git history says who wrote it, not who approved it — or returns it with a reason the author reads. Moderators and admins do not queue. Nothing a member writes reaches the repository before approval, because a commit to it *is* publication: the webhook starts the pipeline. A proposal's picture stays private in /data/uploads until then, and the private copy goes when the public one is committed. There is deliberately no way to promote a wall thread into a proposal. The moderator role needed the role CHECK widened, and SQLite has no DROP CONSTRAINT, so migration 4 rebuilds `members` — eight tables reference it, the one-owner index has to be recreated by hand, and PRAGMA foreign_key_check runs before the commit. One trap worth recording: the allowed roles can only be read back out of sqlite_master's verbatim CREATE TABLE text, comments included, so schema.sql's own comment explaining the rebuild made the step decide it had already run. The start-up test caught it; comments are stripped now. A moderator curates content and has no power over people: no creating, suspending, promoting or erasing anybody. set_role moved from owner-only to admin-level so moderators can be appointed routinely, and checks may_create on the new role as well, so admins still cannot mint admins. content.py splits per collection — posts need a moderator, the site's static pages need an admin. Also: erasure deletes a member's submissions and their pictures and clears reviewed_by, which the existing foreign-key guard forced; deploy-board.sh takes a backup before restarting, since two migrations now rebuild a table in place and one of them holds your own account; README and docs/server-setup.md updated for the roles, the sections and migration 4. 370 tests pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn |