vienalatina/apps/board/templates/comment_form.html
Claude 3e610ac5d2
A title nobody has to write, a fold, a switch and a button
Four changes to the forms people write in.

**The title is optional**, and says nothing about it: a field labelled
«(opcional)» is a field asking to be filled in. An untitled post is
«Sin Título» and the next is «Sin Título 2», so a list of them can still
be told apart and linked to. apps/board/titles.py holds the rule.

The numbering is done per place, against what is already there. The wall
and the queue count every title in the table, deleted rows included — a
number that comes back is a thread that looks like one somebody
remembers reading. A public post counts the *filenames* in its folder
instead, because that is what collides in a repository: two untitled
posts on one day would both be `<fecha>-sin-titulo.es.md`, and the
second would have failed as "somebody else saved this file while you
were editing it", which is a message about a conflict that never
happened. Clearing the title on an edit excludes the file being edited
from its own check, so saving three times does not rename it three
times.

**The event box folds away.** Most posts are not events, and three date
pickers between the title and the text are three fields most people
scroll past. A <details>, like the account menu, so no script is
involved; it opens by itself when the post already has a date.

**The AI disclosure is a switch** rather than a checkbox — what it says
is a statement about the text, not a detail of the form, and it should
look like something that is on or off. Drawn entirely from the
checkbox's own :checked state: under a policy with no 'unsafe-inline' a
control that needs a script is a control that silently does nothing. The
input stays in the tab order and keeps its label, so it works from a
keyboard, and it is anchored inside its own label rather than left
adrift over the page.

**Cancelar is a button**, and Vista previa beside it is shaped the same:
leaving is the other half of a decision and should be the same size as
the half next to it. Quiet rather than filled, so the eye still knows
which one publishes.

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

23 lines
994 B
HTML

{% extends "base.html" %}
{% block title %}Editar respuesta{% endblock %}
{% block main %}
<form class="card" method="post" action="{{ url_for('board.edit_comment', comment_id=comment.id) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<h1>Editar respuesta</h1>
<label for="body">Mensaje</label>
<textarea id="body" data-markdown name="body" rows="10" required>{{ comment.body_md }}</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(comment.body_md) }}</template>
<div class="actions">
<button class="btn" type="submit">Guardar</button>
<a class="btn btn--quiet" href="{{ url_for('board.thread', thread_id=comment.thread_id) }}">Cancelar</a>
</div>
</form>
{% endblock %}