vienalatina/apps/board/templates/member_new.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

50 lines
1.9 KiB
HTML

{% extends "base.html" %}
{% block title %}Dar de alta{% endblock %}
{% block main %}
<form class="card" method="post" action="{{ url_for('members.new') }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<h1>Dar de alta a alguien</h1>
<label for="login">Usuario</label>
<input id="login" name="login" required pattern="[A-Za-z0-9][A-Za-z0-9._\-]*"
placeholder="maria.lopez">
<p class="muted small">Letras, números, punto, guion y guion bajo.</p>
<label for="display_name">Nombre</label>
<input id="display_name" name="display_name" placeholder="María López">
<label for="email">Correo</label>
<input id="email" name="email" type="email" required
placeholder="maria@ejemplo.com">
<p class="muted small">Ahí llega la invitación para elegir contraseña.</p>
{% if not can_send_mail %}
{# Not an error: the account is still created and the invitation still
issued. But it leaves by hand, and finding that out after filling the
form is how an invitation ends up believed sent and never delivered. #}
<p class="muted small">
Este servidor todavía no envía correo, así que la invitación no se
enviará sola: al terminar te mostraremos el enlace para que se lo pases.
</p>
{% endif %}
<label for="role">Rol</label>
<select id="role" name="role">
<option value="user">Miembro — escribe en el muro y propone publicaciones</option>
<option value="moderator">Moderador — además aprueba lo que proponen</option>
{% if can_make_admin %}
<option value="admin">Administrador — además gestiona miembros y páginas</option>
{% endif %}
</select>
{% if not can_make_admin %}
<p class="muted small">Sólo el responsable puede nombrar administradores.</p>
{% endif %}
<div class="actions">
<button class="btn" type="submit">Dar de alta</button>
<a class="btn btn--quiet" href="{{ url_for('members.index') }}">Cancelar</a>
</div>
</form>
{% endblock %}