vienalatina/apps/board/templates/content_list.html
Claude ff115c1d6b
A post can say that a machine wrote it
A switch beside the button that publishes — on the editor, on a member's
proposal and on a wall thread — and a pill next to the date wherever the
post is read: the article, the cards in the listings, the thread, the
wall's list, and the moderator's review screen. Next to the date rather
than under the text, because a disclosure somebody meets after reading
the thing is not a disclosure.

Where it lives follows what the thing is. A public post carries
`ai_generated: true` in its own frontmatter, written only when true —
the file in the repository is the record, and `ai_generated: false` on
every post ever written is noise in git and a question in the mind of
whoever reads one. A thread carries a column. A proposal carries a
column too, and that is the one place it has to be moved by hand: a
proposal is a draft in SQLite until it is approved, so the frontmatter
it will end up in does not exist while the decision is being made, and
losing it there would lose it exactly when the text stops being private.

`content.edit` loads the flag back into the form, for the same reason
the byline is carried through: a field read but not written back is a
field that one corrected typo silently removes.

The pipeline needs nothing. translate.py copies the whole frontmatter
and rewrites only TRANSLATED_KEYS, so the flag reaches the German and
Portuguese siblings by itself — right rather than lucky, since a
translated post was still machine-written. Asserted against the real
list, so a key quietly added to it fails the suite.

Migration 9: three plain ADD COLUMNs, tested against a database with a
thread, a proposal and a cached post already in it.

The three words are in partials/t.html with the theme's other labels.
This is also the shape the EU AI Act's Article 50 asks for, which is
worth knowing for whoever installs this for a second organisation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
2026-10-06 20:19:06 +00:00

70 lines
2.9 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ meta.label }}{% endblock %}
{% block main %}
<div class="feed-head">
<h1>Contenido</h1>
<a class="btn" href="{{ url_for('content.new', collection=collection) }}">{{ meta.new_label }}</a>
</div>
<nav class="tabs" aria-label="Tipo de contenido">
{% for key, other in collections.items() %}
<a class="tab {{ 'tab--on' if key == collection }}"
href="{{ url_for('content.index', collection=key) }}">{{ other.label }}</a>
{% endfor %}
</nav>
{% if not items %}
<article class="card">
<p class="muted">Todavía no hay nada aquí.</p>
</article>
{% else %}
<table class="table">
<thead>
<tr><th>Título</th>{% if meta.dated %}<th>Fecha</th>{% endif %}{% if meta.dated %}<th>Evento</th>{% endif %}<th></th></tr>
</thead>
<tbody>
{% for item in items %}
<tr>
<td>
<a href="{{ url_for('content.edit', collection=collection, name=item.name) }}">{{ item.title }}</a>
<div class="muted small mono">{{ item.name }}</div>
{% if item.ai_generated %}<span class="tag tag--ai" title="Quien lo publicó marcó este texto como generado con inteligencia artificial.">Generado con IA</span>{% endif %}
</td>
{# data-label is drawn by board.css under 640px, where the header row
is hidden and a bare date in a stacked card says nothing. #}
{% if meta.dated %}<td data-label="Fecha">{{ item.date }}</td>{% endif %}
{# The column that used to hold the categories. An event date is the
one thing left that changes what a post is, and it is what a
moderator scanning this list is looking for. #}
{% if meta.dated %}<td data-label="Evento">{{ item.event_date }}</td>{% endif %}
{# The flex row goes INSIDE the cell, never on it. `.actions` is
display:flex, and 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 height, so the columns' lines no longer meet. The page
still renders, which is why this survived two rounds of looking at
it. test_templates.py now fails if it comes back. #}
<td>
<div class="actions actions--row">
<a class="linkish" href="{{ url_for('content.edit', collection=collection, name=item.name) }}">Editar</a>
<form method="post"
action="{{ url_for('content.delete', collection=collection, name=item.name) }}"
data-confirm="Se eliminará «{{ item.title }}» del sitio público. ¿Seguro?">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="linkish linkish--danger" type="submit">Eliminar</button>
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<p class="muted small">
Se escribe en español. El alemán y el portugués los genera la traducción
automática un par de minutos después de publicar, y no se editan aquí: para
corregir una traducción a mano, marca «traducción manual» en ese archivo.
</p>
{% endblock %}