vienalatina/apps/board/templates/submissions.html
Claude 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
2026-10-02 12:19:08 +00:00

93 lines
3.3 KiB
HTML

{% extends "base.html" %}
{% from "_person.html" import person %}
{% block title %}Publicaciones{% endblock %}
{% block main %}
<div class="feed-head">
<h1>Publicaciones</h1>
{% if can_moderate %}
{# A moderator cannot open Gestión, so this is their only route to what is
already on the site. It was a clause inside a paragraph below, which is
the same as not being there. #}
<div class="feed-head__actions">
<a class="linkish" href="{{ url_for('content.index', collection='post') }}">Ya publicado</a>
<a class="btn" href="{{ url_for('content.new', collection='post') }}">Publicar</a>
</div>
{% else %}
<a class="btn" href="{{ url_for('submissions.propose') }}">Proponer</a>
{% endif %}
</div>
<p class="muted">
{% if can_moderate %}
Lo que publicas aquí sale al sitio en cuanto lo guardas. Lo que proponen los
miembros espera en esta cola hasta que tú u otro moderador lo apruebe.
{% else %}
Esto va a vienalatina.com, donde lo lee cualquiera. Un moderador lo lee
primero: si hace falta cambiar algo te lo devuelve con el motivo.
{% endif %}
</p>
{% if can_moderate %}
<h2 class="section-head">Esperando revisión</h2>
{% if not queue %}
<article class="card"><p class="muted">Nada pendiente. La cola está vacía.</p></article>
{% endif %}
{% for item in queue %}
<article class="card">
<div class="card__meta">
<span>{{ person(item.author, item.author_login, item.author_published) }}</span> · <time>{{ item.created_at }}</time>
</div>
<h3 class="card__title">
<a href="{{ url_for('submissions.show', submission_id=item.id) }}">{{ item.title }}</a>
</h3>
<p class="card__excerpt">{{ excerpt(item.body_md) }}</p>
<div class="card__foot actions actions--row">
<a class="linkish" href="{{ url_for('submissions.show', submission_id=item.id) }}">Leer y revisar</a>
</div>
</article>
{% endfor %}
{% endif %}
<h2 class="section-head">Lo que he propuesto</h2>
{% if not mine %}
<article class="card">
<p class="muted">
{% if can_moderate %}
Nada. Tus publicaciones no pasan por aquí: van directas al sitio.
{% else %}
Todavía no has propuesto nada.
{% endif %}
</p>
</article>
{% endif %}
{% for item in mine %}
<article class="card">
<div class="card__meta">
<span class="tag tag--{{ item.state }}">{{ labels[item.state] }}</span>
<time>{{ item.created_at }}</time>
</div>
<h3 class="card__title">
<a href="{{ url_for('submissions.show', submission_id=item.id) }}">{{ item.title }}</a>
</h3>
{% if item.state == 'rejected' and item.note %}
{# The reason, on the list rather than one click away: it is the only thing
the author needs in order to know what to do next. #}
<p class="card__excerpt"><strong>Motivo:</strong> {{ item.note }}</p>
{% endif %}
<div class="card__foot actions actions--row">
{% if item.state != 'approved' %}
<a class="linkish" href="{{ url_for('submissions.edit', submission_id=item.id) }}">Editar</a>
<form method="post" action="{{ url_for('submissions.withdraw', submission_id=item.id) }}"
data-confirm="Se borrará la propuesta «{{ item.title }}». ¿Seguro?">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="linkish linkish--danger" type="submit">Retirar</button>
</form>
{% elif item.published_path %}
<span class="muted small">Publicado en {{ item.published_path }}</span>
{% endif %}
</div>
</article>
{% endfor %}
{% endblock %}