*Privados* was a section holding a list of conversations, and *Miembros* was a page reached from the footer. That is backwards: the list of conversations is a by-product and the people are the thing. So the navigation swaps them — **Inicio · Muro · Miembros · Publicaciones · Calendario · Gestión** — the grid becomes faces and names, and writing to somebody and reading what the two of you have written each other both happen on their page. `/comunidad/miembro/<usuario>` is new, keyed on the login so the address matches the public one. It carries their photo, bio and links, a link out to their public page when they have published one, the whole conversation with them, the write box, block/unblock, and — for an admin — the controls that used to be folded into every card in the directory. `conversation.html` and `inbox.html` are gone; `member.html` replaces both. The split between the two modules did not move. `messages.py` still owns every rule about private messages — who may read a conversation, what counts as having read it, when the conversation comes into being, who may write to whom — and hands the page its contents through the new `history()`. What is left of its routes are the ones that change something: a message sent, a block set or lifted. `members.show` renders. Not losing the unread badge is the part with a real design question in it, and it takes four things: the badge moves to *Miembros*, each card carries its own count, the cards with something unread sort to the top of the grid, and Inicio keeps the panel it already had. Without the sort, the person waiting for an answer is wherever the alphabet put them, which is the one thing the inbox did that a grid of faces does not. Names now link inside. `_person.html` used to link to somebody's *public* page and only when they had published one, so most names on the wall were plain text and there was no way to get from a post to writing to its author. Every caller is behind the login, so it points at the members-area page instead — with the tombstone as the one name with nothing behind it. Old addresses redirect: `/comunidad/privados` to the directory, `/comunidad/privados/con/<id>` to that person's page. The POST that sends a message keeps its address, which is what the form on the new page uses. 512 tests pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
94 lines
4.0 KiB
HTML
94 lines
4.0 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 %}
|
|
<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 %}
|