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
82 lines
3.0 KiB
HTML
82 lines
3.0 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}{{ 'Editar' if item else 'Nuevo' }} {{ meta.singular|lower }}{% endblock %}
|
|
|
|
{% set f = fields or {} %}
|
|
|
|
{% block main %}
|
|
{% if preview_html %}
|
|
<article class="card">
|
|
<div class="card__meta"><span class="tag tag--quiet">Vista previa</span></div>
|
|
<h1 class="card__title">{{ f.title }}</h1>
|
|
<div class="prose">{{ preview_html }}</div>
|
|
</article>
|
|
{% endif %}
|
|
|
|
<form class="card" method="post" enctype="multipart/form-data"
|
|
action="{{ url_for('content.edit', collection=collection, name=item.name) if item
|
|
else url_for('content.new', collection=collection) }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
{% if item %}
|
|
<input type="hidden" name="sha" value="{{ item.sha }}">
|
|
<input type="hidden" name="name" value="{{ item.name }}">
|
|
{% endif %}
|
|
{# The byline travels with the document, like the date and the image path.
|
|
An edit keeps whoever wrote it; only publishing sets it. #}
|
|
{% if f and f.author %}
|
|
<input type="hidden" name="author" value="{{ f.author }}">
|
|
<input type="hidden" name="author_url" value="{{ f.author_url or '' }}">
|
|
{% endif %}
|
|
|
|
<h1>{{ ('Editar ' ~ meta.singular|lower) if item else meta.new_label }}</h1>
|
|
|
|
<label for="title">Título</label>
|
|
<input id="title" name="title" maxlength="140" required value="{{ f.title or '' }}">
|
|
|
|
{% if meta.dated %}
|
|
<label for="date">Fecha</label>
|
|
<input id="date" name="date" type="date" required value="{{ f.date or today }}">
|
|
{% endif %}
|
|
|
|
{% if collection == 'post' %}
|
|
<fieldset class="fieldset">
|
|
<legend>Categorías</legend>
|
|
{% for category in categories %}
|
|
<label class="check">
|
|
<input type="checkbox" name="categories" value="{{ category }}"
|
|
{{ 'checked' if category in (f.categories or []) }}>
|
|
{{ category }}
|
|
</label>
|
|
{% endfor %}
|
|
</fieldset>
|
|
|
|
<label for="description">Resumen</label>
|
|
<textarea id="description" name="description" rows="2">{{ f.description or '' }}</textarea>
|
|
|
|
<label for="picture">Imagen destacada</label>
|
|
{% if f.image %}
|
|
<p class="muted small">Actual: <span class="mono">{{ f.image }}</span> — sube otra para reemplazarla.</p>
|
|
<input type="hidden" name="image" value="{{ f.image }}">
|
|
{% endif %}
|
|
<input id="picture" name="picture" type="file" accept="image/*">
|
|
{% endif %}
|
|
|
|
<label for="body">Cuerpo</label>
|
|
<textarea id="body" name="body" rows="18" required
|
|
placeholder="Markdown: **negrita**, ## títulos, listas, [enlaces](https://…).">{{ body }}</textarea>
|
|
|
|
<label class="check">
|
|
<input type="checkbox" name="manual_translation" {{ 'checked' if f.manual_translation }}>
|
|
Traducción manual — no generar alemán ni portugués para esto
|
|
</label>
|
|
|
|
<div class="actions">
|
|
<button class="btn" type="submit">{{ 'Guardar' if item else 'Publicar' }}</button>
|
|
<button class="linkish" type="submit"
|
|
formaction="{{ url_for('content.preview', collection=collection) }}">
|
|
Vista previa
|
|
</button>
|
|
<a class="linkish" href="{{ url_for('content.index', collection=collection) }}">Cancelar</a>
|
|
</div>
|
|
</form>
|
|
{% endblock %}
|