refactor(templates): use timeago filter in _live_state.html

Replaces three bespoke (now - x).total_seconds() expressions with the
shared filter, unifying vocabulary (no more '0m ago' inside the first
minute) and adding the UTC tooltip.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
mwiegand 2026-05-16 11:12:26 +02:00
parent d9cee233ab
commit 99e477700a
No known key found for this signature in database

View file

@ -7,7 +7,7 @@
{% if snapshot.hibernating %}· idle{% endif %} {% if snapshot.hibernating %}· idle{% endif %}
· {{ snapshot.map }} · {{ snapshot.map }}
<small class="muted"> <small class="muted">
polled {{ ((now - snapshot.last_seen_at).total_seconds() | int) }}s ago polled {{ snapshot.last_seen_at | timeago }}
</small> </small>
</p> </p>
{% endif %} {% endif %}
@ -28,7 +28,7 @@
<span class="name">{{ (profile and profile.persona_name) or session.name_at_join }}</span> <span class="name">{{ (profile and profile.persona_name) or session.name_at_join }}</span>
</a> </a>
<span class="meta"> <span class="meta">
joined {{ ((now - session.joined_at).total_seconds() // 60) | int }}m ago joined {{ session.joined_at | timeago }}
· ping {{ session.min_ping }}-{{ session.max_ping }}ms · ping {{ session.min_ping }}-{{ session.max_ping }}ms
</span> </span>
</li> </li>
@ -52,7 +52,7 @@
<span class="name">{{ row.persona_name or row.name_at_join }}</span> <span class="name">{{ row.persona_name or row.name_at_join }}</span>
</a> </a>
<span class="meta"> <span class="meta">
last seen {{ ((now - row.last_seen).total_seconds() // 60) | int }}m ago last seen {{ row.last_seen | timeago }}
</span> </span>
</li> </li>
{% endfor %} {% endfor %}