Half of this already existed and nothing said so. `threads.pinned` has
been in the schema since the board shipped, with an index on it and a
toggle route, but it was @admin_required, reachable only from inside a
thread, and Inicio ignored it.
Who. Moderators and above, on both halves. Curating what the public
reads is the whole of a moderator's job, and content.py has said so
since the queue was built. Locking a thread rides the same route and is
still an admin's: it stops named people saying anything more to each
other, which is power over people rather than over content, and this
codebase keeps those apart everywhere else.
What is stored. A moment, not a flag — several posts can be pinned and
the newest pin goes first, so the value is the order. `pinned:
'2026-10-13T12:00:00'` in a post's own frontmatter, written only when
true; `threads.pinned_at` beside the flag the wall already had, cleared
on unpinning so that pinning again puts it where a new pin belongs. One
key carrying both means `{{ if .Params.pinned }}` still reads as a
yes/no and nothing has to be kept in step with anything.
translate.py needs nothing: it copies the whole frontmatter and rewrites
only TRANSLATED_KEYS, so a pinned post is pinned in German too. Asserted
against the real list rather than assumed.
Two ways to pin a public post — the switch beside Publicar, and one
press in the Contenido list, because deciding what the site leads with
means looking at the list rather than opening each post to find out what
is in it. Both commit; the file is the record.
Migration 10 adds the columns and recreates the wall's index, which now
names pinned_at. `CREATE INDEX IF NOT EXISTS` leaves an existing index
exactly as it is, so without that a running server keeps the old
definition forever while a fresh install gets the new one. Nothing
breaks either way, which is the problem.
Checked rather than assumed: built with Hugo 0.135.0 and the pipeline's
flags, two pinned posts come out above a newer unpinned one and in
pin order rather than post order, with the pill on the cards and on the
article. And the wall rendered at 390px, where the pinned thread leads
and nothing overflows.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
87 lines
3.1 KiB
HTML
87 lines
3.1 KiB
HTML
{% extends "base.html" %}
|
|
{% from "_person.html" import person %}
|
|
{% block title %}Inicio{% endblock %}
|
|
|
|
{% block main %}
|
|
<div class="feed-head">
|
|
<h1>Hola, {{ g.member.display_name }}</h1>
|
|
<span class="muted small">{{ people }} miembro{{ '' if people == 1 else 's' }} activo{{ '' if people == 1 else 's' }}</span>
|
|
</div>
|
|
|
|
{# Panels in the order things get acted on: what is waiting for me, then what
|
|
is waiting for everybody, then what I have sent somewhere. #}
|
|
{% if queue %}
|
|
<section class="panel panel--attention">
|
|
<div class="panel__head">
|
|
<h2>Para revisar</h2>
|
|
<a class="linkish" href="{{ url_for('submissions.index') }}">Ver la cola</a>
|
|
</div>
|
|
{% for item in queue %}
|
|
<p class="panel__row">
|
|
<a href="{{ url_for('submissions.show', submission_id=item.id) }}">{{ item.title }}</a>
|
|
<span class="muted small">{{ person(item.author, item.author_login) }} · {{ item.created_at }}</span>
|
|
</p>
|
|
{% endfor %}
|
|
</section>
|
|
{% endif %}
|
|
|
|
<section class="panel">
|
|
<div class="panel__head">
|
|
<h2>Privados</h2>
|
|
<a class="linkish" href="{{ url_for('members.index') }}">Miembros</a>
|
|
</div>
|
|
{% if not conversations %}
|
|
<p class="muted">Todavía no tienes conversaciones. Abre la ficha de alguien en Miembros y escríbele.</p>
|
|
{% endif %}
|
|
{% for c in conversations %}
|
|
<p class="panel__row">
|
|
<a href="{{ url_for('members.show', login=c.other_login) }}">{{ c.other_name }}</a>
|
|
{% if c.unread %}<span class="tag">{{ c.unread }}</span>{% endif %}
|
|
{% if c.last_at %}<span class="muted small">{{ c.last_at }}</span>{% endif %}
|
|
</p>
|
|
{% endfor %}
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<div class="panel__head">
|
|
<h2>Muro</h2>
|
|
<a class="linkish" href="{{ url_for('board.threads') }}">Todo el muro</a>
|
|
</div>
|
|
{% if not threads %}
|
|
<p class="muted">El muro está vacío. <a href="{{ url_for('board.new_thread') }}">Escribe el primero.</a></p>
|
|
{% endif %}
|
|
{% for t in threads %}
|
|
<p class="panel__row">
|
|
{# This panel orders by the pin like the wall does, so it has to say
|
|
which one is pinned or the order looks arbitrary from here. #}
|
|
{% if t.pinned %}<span class="tag">Fijado</span> {% endif %}
|
|
<a href="{{ url_for('board.thread', thread_id=t.id) }}">{{ t.title }}</a>
|
|
<span class="muted small">{{ person(t.author, t.author_login) }} · {{ t.replies }} respuesta{{ '' if t.replies == 1 else 's' }}</span>
|
|
</p>
|
|
{% endfor %}
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<div class="panel__head">
|
|
<h2>Mis publicaciones</h2>
|
|
<a class="linkish" href="{{ url_for('submissions.index') }}">Publicaciones</a>
|
|
</div>
|
|
{% if not mine %}
|
|
<p class="muted">
|
|
{% if may_moderate() %}
|
|
Puedes publicar directamente en el sitio desde <a href="{{ url_for('content.index') }}">Publicaciones</a>.
|
|
{% else %}
|
|
¿Tienes algo que contarle al barrio? <a href="{{ url_for('submissions.propose') }}">Propón una publicación</a>
|
|
y un moderador la leerá antes de publicarla.
|
|
{% endif %}
|
|
</p>
|
|
{% endif %}
|
|
{% for item in mine %}
|
|
<p class="panel__row">
|
|
<a href="{{ url_for('submissions.show', submission_id=item.id) }}">{{ item.title }}</a>
|
|
<span class="tag tag--{{ item.state }}">{{ state_labels[item.state] }}</span>
|
|
</p>
|
|
{% endfor %}
|
|
</section>
|
|
{% endblock %}
|