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
95 lines
4.2 KiB
HTML
95 lines
4.2 KiB
HTML
{% extends "base.html" %}
|
|
{% from "_person.html" import person %}
|
|
{% from "_reaction.html" import reaction %}
|
|
{% from "_attachments.html" import attachments %}
|
|
{% block title %}{{ thread.title }}{% endblock %}
|
|
|
|
{% block main %}
|
|
<article class="card">
|
|
<div class="card__meta">
|
|
{% if thread.pinned %}<span class="tag">Fijado</span>{% endif %}
|
|
{% if thread.locked %}<span class="tag tag--quiet">Cerrado</span>{% endif %}
|
|
{% if thread.ai_generated %}<span class="tag tag--ai" title="Quien lo publicó marcó este texto como generado con inteligencia artificial.">Generado con IA</span>{% endif %}
|
|
<span>{{ person(author.display_name, author.gitea_login) }}</span> · <time>{{ thread.created_at }}</time>
|
|
{% if thread.edited_at %}<span class="muted small">(editado)</span>{% endif %}
|
|
</div>
|
|
<h1 class="card__title">{{ thread.title }}</h1>
|
|
<div class="prose">{{ body_html }}</div>
|
|
{{ attachments(thread_images) }}
|
|
|
|
<div class="actions">
|
|
{{ reaction('thread', thread.id, reactions.get(thread.id),
|
|
url_for('board.thread', thread_id=thread.id)) }}
|
|
{% if may_edit(thread) %}
|
|
<a class="linkish" href="{{ url_for('board.edit_thread', thread_id=thread.id) }}">Editar</a>
|
|
{% endif %}
|
|
{% if may_delete(thread) %}
|
|
<form method="post" action="{{ url_for('board.delete_thread', thread_id=thread.id) }}"
|
|
data-confirm="¿Eliminar este tema?">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<button class="linkish linkish--danger" type="submit">Eliminar</button>
|
|
</form>
|
|
{% endif %}
|
|
{% if is_admin %}
|
|
<form method="post" action="{{ url_for('board.set_state', thread_id=thread.id) }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<input type="hidden" name="field" value="pinned">
|
|
<input type="hidden" name="value" value="{{ 0 if thread.pinned else 1 }}">
|
|
<button class="linkish" type="submit">{{ 'No fijar' if thread.pinned else 'Fijar' }}</button>
|
|
</form>
|
|
<form method="post" action="{{ url_for('board.set_state', thread_id=thread.id) }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<input type="hidden" name="field" value="locked">
|
|
<input type="hidden" name="value" value="{{ 0 if thread.locked else 1 }}">
|
|
<button class="linkish" type="submit">{{ 'Reabrir' if thread.locked else 'Cerrar' }}</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
</article>
|
|
|
|
<h2 class="section-head">{{ comments|length }} respuesta{{ '' if comments|length == 1 else 's' }}</h2>
|
|
|
|
{% for c in comments %}
|
|
<article class="card card--comment" id="c{{ c.id }}">
|
|
<div class="card__meta">
|
|
<span>{{ person(c.author, c.author_login) }}</span> · <time>{{ c.created_at }}</time>
|
|
{% if c.edited_at %}<span class="muted small">(editado)</span>{% endif %}
|
|
</div>
|
|
<div class="prose">{{ to_html(c.body_md) }}</div>
|
|
{{ attachments(comment_images.get(c.id, [])) }}
|
|
<div class="actions">
|
|
{{ reaction('comment', c.id, comment_reactions.get(c.id),
|
|
url_for('board.thread', thread_id=thread.id) ~ '#c' ~ c.id) }}
|
|
{% if may_edit(c) %}
|
|
<a class="linkish" href="{{ url_for('board.edit_comment', comment_id=c.id) }}">Editar</a>
|
|
{% endif %}
|
|
{% if may_delete(c) %}
|
|
<form method="post" action="{{ url_for('board.delete_comment', comment_id=c.id) }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<button class="linkish linkish--danger" type="submit">Eliminar</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
</article>
|
|
{% endfor %}
|
|
|
|
<span id="final"></span>
|
|
|
|
{% if thread.locked and not is_admin %}
|
|
<p class="muted">Este tema está cerrado a nuevas respuestas.</p>
|
|
{% else %}
|
|
<form class="card" method="post" enctype="multipart/form-data"
|
|
action="{{ url_for('board.comment', thread_id=thread.id) }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<label for="body">Responder</label>
|
|
<textarea id="body" data-markdown name="body" rows="5" required
|
|
placeholder="Se puede usar Markdown: **negrita**, listas, enlaces."></textarea>
|
|
|
|
<label for="pictures">Imágenes <span class="muted small">(opcional)</span></label>
|
|
<input id="pictures" name="pictures" type="file" multiple accept="image/*">
|
|
|
|
<button class="btn" type="submit">Publicar respuesta</button>
|
|
</form>
|
|
{% endif %}
|
|
{% endblock %}
|