vienalatina/apps/board/templates/content_list.html
Claude 59b595170f
A calendar a phone can read, and tap targets a thumb can hit
The private calendar rendered as six hundred pixels of nothing on a phone.
The cause was two adjacent rules in board.css with opposite outcomes:

    .cal, .cal tbody, .cal tr, .cal td { display: block }   /* (0,1,1) */
    .cal__pad { display: none }                             /* (0,1,0) */
    .cal__day:not(:has(.cal__event)) { display: none }      /* (0,2,0) */

`.cal td` outranks `.cal__pad`, so every cell belonging to a neighbouring
month stayed on screen as a 92px empty box; `.cal__day:not(:has(…))`
outranks `.cal td`, so every real day disappeared. A month with no events
drew four blank boxes and nothing else, with correct HTML throughout —
which is why reading the file looked right and no test could see it.

Both calendars are now a column of every day of the month below 640px,
with the weekday beside the number (the column header is hidden there),
the days carrying something standing out, and a line saying so when the
month is empty. The public agenda gets the same shape deliberately: the
private calendar lists the public events, and a member moves between the
two. Every rule that decides `display` now names its cell's own class.

Measured rather than reasoned about, in headless Chromium at 320 and 390
across all 22 members-area screens and the public site in three languages:

  - padding cells 0px tall, 31 of 31 days drawn, no horizontal overflow
  - the ☰ ran off the right edge of a 320px Portuguese home page, because
    «Comunidade» is three letters longer than «Comunidad»; the bar now
    gives way at 360px
  - the navigation links were 37x17, the calendar's + was 7x15, the footer
    links 16px tall. A `pointer: coarse` block in each stylesheet raises
    them to 44, padding only, so the desktop is untouched. Links inside a
    sentence are left alone, as WCAG exempts them.

Registro de actividad and Contenido stop being a sideways-scrolling table
on a phone and stack one card per row, the two columns that do not
describe themselves labelled from `data-label`.

Guards: three stylesheet tests that compute specificity and run the
cascade for a padding cell, a day cell and the weekday label, in both
stylesheets — each verified by putting the shipped rules back. Plus three
request-level tests: an empty month says so and still draws its 31 days,
a month with events does not claim to be empty, and every day carries the
right weekday.

Members area only to deploy — no migration, no schema change — except the
agenda and the stylesheet, which reach the site through the pipeline.

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

69 lines
2.7 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ meta.label }}{% endblock %}
{% block main %}
<div class="feed-head">
<h1>Contenido</h1>
<a class="btn" href="{{ url_for('content.new', collection=collection) }}">{{ meta.new_label }}</a>
</div>
<nav class="tabs" aria-label="Tipo de contenido">
{% for key, other in collections.items() %}
<a class="tab {{ 'tab--on' if key == collection }}"
href="{{ url_for('content.index', collection=key) }}">{{ other.label }}</a>
{% endfor %}
</nav>
{% if not items %}
<article class="card">
<p class="muted">Todavía no hay nada aquí.</p>
</article>
{% else %}
<table class="table">
<thead>
<tr><th>Título</th>{% if meta.dated %}<th>Fecha</th>{% endif %}{% if meta.dated %}<th>Evento</th>{% endif %}<th></th></tr>
</thead>
<tbody>
{% for item in items %}
<tr>
<td>
<a href="{{ url_for('content.edit', collection=collection, name=item.name) }}">{{ item.title }}</a>
<div class="muted small mono">{{ item.name }}</div>
</td>
{# data-label is drawn by board.css under 640px, where the header row
is hidden and a bare date in a stacked card says nothing. #}
{% if meta.dated %}<td data-label="Fecha">{{ item.date }}</td>{% endif %}
{# The column that used to hold the categories. An event date is the
one thing left that changes what a post is, and it is what a
moderator scanning this list is looking for. #}
{% if meta.dated %}<td data-label="Evento">{{ item.event_date }}</td>{% endif %}
{# The flex row goes INSIDE the cell, never on it. `.actions` is
display:flex, and a <td> told to be a flex container stops being a
table cell: it leaves the row's layout and draws its bottom border
at its own height, so the columns' lines no longer meet. The page
still renders, which is why this survived two rounds of looking at
it. test_templates.py now fails if it comes back. #}
<td>
<div class="actions actions--row">
<a class="linkish" href="{{ url_for('content.edit', collection=collection, name=item.name) }}">Editar</a>
<form method="post"
action="{{ url_for('content.delete', collection=collection, name=item.name) }}"
data-confirm="Se eliminará «{{ item.title }}» del sitio público. ¿Seguro?">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="linkish linkish--danger" type="submit">Eliminar</button>
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<p class="muted small">
Se escribe en español. El alemán y el portugués los genera la traducción
automática un par de minutos después de publicar, y no se editan aquí: para
corregir una traducción a mano, marca «traducción manual» en ese archivo.
</p>
{% endblock %}