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
45 lines
2.2 KiB
HTML
45 lines
2.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}{{ 'Editar tema' if thread else 'Escribir' }}{% endblock %}
|
|
|
|
{% block main %}
|
|
<form class="card" method="post" enctype="multipart/form-data"
|
|
action="{{ url_for('board.edit_thread', thread_id=thread.id) if thread else url_for('board.new_thread') }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<h1>{{ 'Editar tema' if thread else 'Nuevo tema' }}</h1>
|
|
|
|
<label for="title">Título</label>
|
|
<input id="title" name="title" maxlength="140" required
|
|
value="{{ thread.title if thread else '' }}">
|
|
|
|
<label for="body">Mensaje</label>
|
|
<textarea id="body" data-markdown data-rich="full" name="body" rows="14" required
|
|
placeholder="Se puede usar Markdown: **negrita**, listas, enlaces.">{{ thread.body_md if thread else '' }}</textarea>
|
|
{#- The stored markdown, rendered by the server for the editor to adopt.
|
|
There is no markdown parser in the browser: this is how the box can
|
|
show the formatting without a second opinion about what somebody's
|
|
text means. Ignored entirely when scripting is off. -#}
|
|
<template data-rich-html="body">{{ to_html(thread.body_md if thread else '') }}</template>
|
|
|
|
{# Only when writing, not when editing: the edit route does not read files,
|
|
and an input that silently does nothing is worse than no input. Photos
|
|
already attached survive an edit — they are separate rows. #}
|
|
{% if not thread %}
|
|
<label for="pictures">Imágenes <span class="muted small">(opcional)</span></label>
|
|
<input id="pictures" name="pictures" type="file" multiple accept="image/*">
|
|
{% endif %}
|
|
|
|
<div class="actions">
|
|
<button class="btn" type="submit">{{ 'Guardar' if thread else 'Publicar' }}</button>
|
|
{#- Beside the button that publishes, because that is the moment it is
|
|
answered. One line rather than a fieldset: it has to be seen, not
|
|
to take up the form. -#}
|
|
<label class="switch">
|
|
<input type="checkbox" name="ai_generated" {{ 'checked' if (thread.ai_generated if thread else False) }}>
|
|
Contenido generado con IA
|
|
</label>
|
|
|
|
<a class="linkish" href="{{ url_for('board.thread', thread_id=thread.id) if thread else url_for('board.threads') }}">Cancelar</a>
|
|
</div>
|
|
</form>
|
|
{% endblock %}
|