vienalatina/apps/board/templates/base.html
Pablo Volenski 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
2026-10-06 12:18:04 +00:00

110 lines
4.5 KiB
HTML

{# Chrome deliberately mirrors the public site's header and footer, so moving
between vienalatina.com and the members area does not feel like leaving. #}
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow">
<title>{% block title %}Comunidad{% endblock %} — Viena Latina</title>
<link rel="stylesheet" href="{{ url_for('static', filename='board.css') }}">
{% block brand_css %}
{# After board.css, so the admin's colours win, and cache-busted by when
they were saved. A generated file rather than an inline <style> because
the CSP has no 'unsafe-inline' — an inline block would simply not apply,
without a word in the console. The Marca screen overrides this block
with nothing, so custom CSS that breaks the page cannot hide the page
that undoes it. #}
<link rel="stylesheet" href="{{ url_for('brand.stylesheet_file') }}?v={{ brand.stamp }}">
{% endblock %}
{% if brand.favicon_name %}
<link rel="icon" type="image/png"
href="{{ url_for('brand.picture', stored_name=brand.favicon_name) }}?v={{ brand.stamp }}">
{% endif %}
<script src="{{ url_for('static', filename='board.js') }}" defer></script>
</head>
<body>
<header class="site-bar">
<div class="site-bar__inner">
<a class="site-bar__brand" href="/">
{% if brand.logo_name %}
<img class="site-bar__logo" alt="Viena Latina"
src="{{ url_for('brand.picture', stored_name=brand.logo_name) }}?v={{ brand.stamp }}">
{% else %}
<span class="site-bar__brand-text">Viena Latina</span>
{% endif %}
</a>
{% if g.member %}
{# <details> rather than a button with a handler: the CSP has no
'unsafe-inline', so a menu that needs onclick="" is a menu that
silently never opens. This one works with the CSS and the HTML
alone. #}
<details class="account">
<summary class="account__name">{{ g.member.display_name }}</summary>
<div class="account__menu">
<a href="{{ url_for('profiles.edit') }}">Mi perfil</a>
<a href="{{ url_for('members.export') }}">Descargar mis datos</a>
<form method="post" action="{{ url_for('auth.logout') }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="linkish" type="submit">Salir</button>
</form>
</div>
</details>
{% endif %}
</div>
{% if g.member %}
<nav class="site-bar__pages" aria-label="Secciones">
{# Six entries, and five of them are the same for everybody. The role
only decides whether Gestión is there — it used to decide three of
them, which is how an ordinary member ended up signing in to a wall
and a member list with their own profile and their own private
messages hidden from them. Account items are in the corner menu
above, because "Mi perfil" is not a section of the site.
*Privados* used to be here, holding a list of conversations. The
people are the section now and the messages live on each person's
page, so the unread badge hangs on Miembros: it is the only thing
left that tells a member somebody wrote to them, which is why it is
also repeated on the card of whoever wrote. #}
<ul class="page-nav">
<li><a href="{{ url_for('home.index') }}">Inicio</a></li>
<li><a href="{{ url_for('board.threads') }}">Muro</a></li>
<li>
<a href="{{ url_for('members.index') }}">Miembros{% set unread = unread_private() %}{% if unread %} <span class="tag">{{ unread }}</span>{% endif %}</a>
</li>
<li>
{# The badge counts what is waiting for a moderator, so for
anybody else the function returns 0 and nothing is drawn. #}
<a href="{{ url_for('submissions.index') }}">Publicaciones{% set waiting = pending_review() %}{% if waiting %} <span class="tag">{{ waiting }}</span>{% endif %}</a>
</li>
<li><a href="{{ url_for('events.month') }}">Calendario</a></li>
{% if is_at_least(g.member.role, 'admin') %}
<li><a href="{{ url_for('home.gestion') }}">Gestión</a></li>
{% endif %}
</ul>
</nav>
{% endif %}
</header>
<div class="page-shell">
<main class="feed">
{% with messages = get_flashed_messages(with_categories=true) %}
{% for category, message in messages %}
<p class="flash flash--{{ category }}">{{ message }}</p>
{% endfor %}
{% endwith %}
{% block main %}{% endblock %}
</main>
<footer class="site-foot">
<a href="/">Ir al sitio público</a>
<div class="site-foot__legal">Viena Latina © {{ current_year }} · Área privada</div>
</footer>
</div>
</body>
</html>