251bd1d3f7
6 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
81d9fae4a9
|
Identidad, tipografías, y tres herramientas de administración
The second half of the superadministrator's job: not just who may do things, but
what they get to do that nobody else does.
**Identidad** is everything that used to be frozen in config.yaml — the name and
the one-line tagline in all three languages, the association's accounts
elsewhere, a public email, a city and street, a share picture and the footer
line. It commits data/site.yaml the way Marca commits data/brand.yaml.
Hugo cannot have config.yaml overridden by a data file, so the name and tagline
are read through two new partials that prefer the data file and fall back to the
config; every template showing either calls one, so they cannot drift. A site
with no data/site.yaml builds byte-for-byte what it built before — asserted by
building both ways and diffing with the stylesheet fingerprint normalised.
The contact fields are not decoration: they become ContactPoint and
PostalAddress in the Organization schema, which is what puts an association in a
local result rather than only a web one, and the social links become sameAs,
which is how an engine knows an Instagram account and this site are one body.
**Marca** grows a typeface and a roundness. Four system stacks — nothing
downloaded, which is deliberate and a GDPR matter — or an uploaded .woff2,
sniffed by its wOF2 signature, capped at 400 KB, named ahead of the old stack so
a font that fails to load leaves a readable site. The fold-out warning covers
missing accented glyphs, file size, synthesised bold, and licensing: a font is
software, a desktop licence is not a webfont licence, and that liability follows
the platform to every organisation it is installed for. SIL OFL and Apache-2.0
are named, with seven places to find them.
**Three tools.** Estado del sistema exercises the content token against the
repository rather than checking it is non-empty — "present" was never the
problem, a wrong scope broke publishing for three phases while looking fine —
and reports mail, backups, disk and every documented setting the container does
not have. It changes nothing on purpose. Registro de actividad records the dozen
acts that change who can do what; the actor is cleared and not cascaded on
erasure, and log() never raises, because an administrator who could not be
appointed because the note about it could not be saved is worse than a gap in
the notes. Biblioteca de medios lists every picture with the posts that use it
and, finally, shows the orphans — a picture whose post was deleted has stayed in
the repository, deployed and unreferenced, for the life of this site with no way
to see one.
Two bugs found by looking at the rendered pages rather than at the tests:
**Gestión had disappeared from the superadministrator's own navigation.**
base.html asked `g.member.role in ('owner', 'admin')`, right until a role
appeared above both. 622 tests passed while it was broken, because every one of
them signed in as an admin or below. The templates now call the same
`is_at_least` the handlers do, and test_navigation.py covers the tier above
admin — verified by reintroducing the tuple and watching it fail.
And the status screen counted the tombstone as a suspended member.
Migration 8 is plain ADD COLUMNs; `activity` and `site` are new tables, so
CREATE TABLE IF NOT EXISTS covers them with no step at all. The erase guard
caught both the moment they existed, which is that test doing its job.
627 tests pass. Hugo builds clean with the pipeline's flags, both with and
without the two data files.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
|
|||
|
91aa0c9a9e
|
Private messages live on the person, not in a tab
*Privados* was a section holding a list of conversations, and *Miembros* was a page reached from the footer. That is backwards: the list of conversations is a by-product and the people are the thing. So the navigation swaps them — **Inicio · Muro · Miembros · Publicaciones · Calendario · Gestión** — the grid becomes faces and names, and writing to somebody and reading what the two of you have written each other both happen on their page. `/comunidad/miembro/<usuario>` is new, keyed on the login so the address matches the public one. It carries their photo, bio and links, a link out to their public page when they have published one, the whole conversation with them, the write box, block/unblock, and — for an admin — the controls that used to be folded into every card in the directory. `conversation.html` and `inbox.html` are gone; `member.html` replaces both. The split between the two modules did not move. `messages.py` still owns every rule about private messages — who may read a conversation, what counts as having read it, when the conversation comes into being, who may write to whom — and hands the page its contents through the new `history()`. What is left of its routes are the ones that change something: a message sent, a block set or lifted. `members.show` renders. Not losing the unread badge is the part with a real design question in it, and it takes four things: the badge moves to *Miembros*, each card carries its own count, the cards with something unread sort to the top of the grid, and Inicio keeps the panel it already had. Without the sort, the person waiting for an answer is wherever the alphabet put them, which is the one thing the inbox did that a grid of faces does not. Names now link inside. `_person.html` used to link to somebody's *public* page and only when they had published one, so most names on the wall were plain text and there was no way to get from a post to writing to its author. Every caller is behind the login, so it points at the members-area page instead — with the tombstone as the one name with nothing behind it. Old addresses redirect: `/comunidad/privados` to the directory, `/comunidad/privados/con/<id>` to that person's page. The POST that sends a message keeps its address, which is what the form on the new page uses. 512 tests pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn |
|||
|
|
5e8ee5ad20
|
Two calendars: one for everybody, one for the members
**Public events are posts.** A new Evento category brings three fields with it — event_date, event_time, event_location — and the first is required, because a post's own `date` is when it was announced and an event announced three weeks early would otherwise land in the agenda on the wrong day. Members propose events through the same queue as everything else, and the date survives approval untouched: the event the member described is the event that gets published. An event's page leads with the day, the time and the place before the title, shows its picture full width, and offers "añadir a mi calendario" — a real .ics beside the page, generated because the editor writes `outputs: ["HTML", "ics"]` into an event's frontmatter and nothing else asks for that format. It carries Event structured data as well as the BlogPosting it already had, which is what puts a date beside the result in a search listing. /page/agenda/ is a month grid per month, every month from the first event to the last built at build time, with a script that shows one and moves between them. That arrangement is the point: with JavaScript off every month is on the page as a list, with it on nothing is fetched to change months, and the month it opens on is the reader's rather than the one the site was built in. Hugo exposes no AddDate, so the length of a month is a table plus the leap rule and the first weekday falls out of formatting the date — it looks like something simpler was missed, and it is not. **The private calendar** is a sixth section: rows in SQLite, written by admins, read by every member, never published. It shows the public events too, marked, so a member has one place to look rather than two — they come from the content_cache the editor's listing already fills, which is why migration 5 adds three columns to it and to submissions. The grid is Python's own calendar.Calendar: no date arithmetic of mine anywhere in it. Two things the tests found on the way: gitea.py let `requests`' own exceptions through. They inherit from OSError, not from GiteaError, so the calendar's careful "keep working while the git server is down" would have been defeated by a refused connection — the page would have 500ed instead. Every transport failure is now a GiteaError, raised at the one place that touches the wire. This is the third bug of exactly that shape in this module. An admin's erasure clears events.created_by rather than reassigning it. The meeting still happens after they leave; the event belongs to the association. 509 tests pass, and the site builds with Hugo 0.135.0 under the pipeline's own --panicOnWarning. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn |
||
|
|
c84a996eef
|
The bar, the share card, the writing box and subpages
**A signed-in member sees the members area from anywhere.** A slim bar above the
public header, with the same five sections /comunidad/ has. Those pages are
files on disk and get cached, so it is drawn in the browser: memberbar.js asks
/comunidad/sesion.json who is reading, and that endpoint is the only thing that
decides — a visitor is told `{"signed_in": false}` and the answer is never
cached. Sign-in also sets vl_sesion=1, a cookie holding one digit that scripts
can read, and without it the script makes no request at all: a stranger reading
one article costs the app nothing. It is a hint, never a credential — the
session cookie stays HttpOnly and signed, and a forged hint earns a reply saying
you are not signed in. Comunidad is now in the public menu in all three
languages, signed in or not.
**The public menu is built from the pages.** It was three names per language in
config.yaml, so a page published through Contenido never appeared on the site at
all and the German and Portuguese menus had to be kept in step by hand. Pages
carry `parent` (another page's basename — the one translate.py already uses to
pair siblings, so it holds in all three languages) and `weight`, both chosen in
the editor, and header.html builds two levels from them. URLs do not change: a
subpage is still /page/<slug>/, only the menu nests, so nothing in the Caddyfile
or the pipeline learns about folders. The dropdown is the theme's own, ported
from WordPress — hover, focus-within, inline on a phone, no script. A parent that
has been deleted is kept and labelled rather than silently dropped on the next
save.
**Sharing and the rest of SEO/GEO.** The groundwork was already here — hreflang,
Open Graph, Twitter card, BlogPosting, llms.txt, robots.txt naming the AI
crawlers — so this closes the gaps. Static pages had *none* of it and shared as
bare links; they now carry WebPage schema and the full set of tags. Both branches
gain og:image with an alt and a twitter:image, falling back to params.defaultImage
(empty until there is a logo, which is the one line to fill in then). The home
page gains Organization with areaServed Wien and a sameAs list; posts and pages
gain BreadcrumbList, and an article's structured data now carries the author's
profile URL. An optional FAQ — `pregunta|respuesta` per line — renders at the
foot of the page and as FAQPage schema, because current guidance for generative
engines puts exactly that shape at the top of what gets quoted, and schema
describing something invisible is what search engines penalise. translate.py
carries both new fields: image_alt joins the translated keys, and faq is
translated half by half so the separator survives.
**The writing boxes.** A markdown toolbar and a Vista previa on every box where
somebody writes prose, opted in with data-markdown. The preview POSTs to
/comunidad/previsualizar and renders with render.to_html — the same function the
board and the site use, so it cannot promise something publishing will not
deliver; a markdown parser in the browser would be a second opinion about what
somebody's text means. Choosing a picture now shows a thumbnail with its name and
size before anything is uploaded, which is the only reason `blob:` joins img-src:
a handle to bytes already in the page, reaching no network.
All of it ours, no dependency added, under a policy that loads scripts from this
origin only. Verified by building the site with Hugo 0.135, the version the
pipeline runs: the nested menu, the page's share tags, the FAQ schema matching
the rendered section, and llms.txt listing the pages.
463 tests pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
|
||
|
|
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 |
||
|
|
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 |