vienalatina/apps/board/templates/submissions.html
Pablo Volenski 91aa0c9a9e
Private messages live on the person, not in a tab
*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
2026-10-03 20:12:16 +00:00

93 lines
3.3 KiB
HTML

{% extends "base.html" %}
{% from "_person.html" import person %}
{% block title %}Publicaciones{% endblock %}
{% block main %}
<div class="feed-head">
<h1>Publicaciones</h1>
{% if can_moderate %}
{# A moderator cannot open Gestión, so this is their only route to what is
already on the site. It was a clause inside a paragraph below, which is
the same as not being there. #}
<div class="feed-head__actions">
<a class="linkish" href="{{ url_for('content.index', collection='post') }}">Ya publicado</a>
<a class="btn" href="{{ url_for('content.new', collection='post') }}">Publicar</a>
</div>
{% else %}
<a class="btn" href="{{ url_for('submissions.propose') }}">Proponer</a>
{% endif %}
</div>
<p class="muted">
{% if can_moderate %}
Lo que publicas aquí sale al sitio en cuanto lo guardas. Lo que proponen los
miembros espera en esta cola hasta que tú u otro moderador lo apruebe.
{% else %}
Esto va a vienalatina.com, donde lo lee cualquiera. Un moderador lo lee
primero: si hace falta cambiar algo te lo devuelve con el motivo.
{% endif %}
</p>
{% if can_moderate %}
<h2 class="section-head">Esperando revisión</h2>
{% if not queue %}
<article class="card"><p class="muted">Nada pendiente. La cola está vacía.</p></article>
{% endif %}
{% for item in queue %}
<article class="card">
<div class="card__meta">
<span>{{ person(item.author, item.author_login) }}</span> · <time>{{ item.created_at }}</time>
</div>
<h3 class="card__title">
<a href="{{ url_for('submissions.show', submission_id=item.id) }}">{{ item.title }}</a>
</h3>
<p class="card__excerpt">{{ excerpt(item.body_md) }}</p>
<div class="card__foot actions actions--row">
<a class="linkish" href="{{ url_for('submissions.show', submission_id=item.id) }}">Leer y revisar</a>
</div>
</article>
{% endfor %}
{% endif %}
<h2 class="section-head">Lo que he propuesto</h2>
{% if not mine %}
<article class="card">
<p class="muted">
{% if can_moderate %}
Nada. Tus publicaciones no pasan por aquí: van directas al sitio.
{% else %}
Todavía no has propuesto nada.
{% endif %}
</p>
</article>
{% endif %}
{% for item in mine %}
<article class="card">
<div class="card__meta">
<span class="tag tag--{{ item.state }}">{{ labels[item.state] }}</span>
<time>{{ item.created_at }}</time>
</div>
<h3 class="card__title">
<a href="{{ url_for('submissions.show', submission_id=item.id) }}">{{ item.title }}</a>
</h3>
{% if item.state == 'rejected' and item.note %}
{# The reason, on the list rather than one click away: it is the only thing
the author needs in order to know what to do next. #}
<p class="card__excerpt"><strong>Motivo:</strong> {{ item.note }}</p>
{% endif %}
<div class="card__foot actions actions--row">
{% if item.state != 'approved' %}
<a class="linkish" href="{{ url_for('submissions.edit', submission_id=item.id) }}">Editar</a>
<form method="post" action="{{ url_for('submissions.withdraw', submission_id=item.id) }}"
data-confirm="Se borrará la propuesta «{{ item.title }}». ¿Seguro?">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="linkish linkish--danger" type="submit">Retirar</button>
</form>
{% elif item.published_path %}
<span class="muted small">Publicado en {{ item.published_path }}</span>
{% endif %}
</div>
</article>
{% endfor %}
{% endblock %}