From 99e477700a504e039fae98449a5c9098a400c0ba Mon Sep 17 00:00:00 2001
From: mwiegand
Date: Sat, 16 May 2026 11:12:26 +0200
Subject: [PATCH] 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)
---
l4d2web/l4d2web/templates/_live_state.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/l4d2web/l4d2web/templates/_live_state.html b/l4d2web/l4d2web/templates/_live_state.html
index 0518b49..cc302ab 100644
--- a/l4d2web/l4d2web/templates/_live_state.html
+++ b/l4d2web/l4d2web/templates/_live_state.html
@@ -7,7 +7,7 @@
{% if snapshot.hibernating %}· idle{% endif %}
· {{ snapshot.map }}
- polled {{ ((now - snapshot.last_seen_at).total_seconds() | int) }}s ago
+ polled {{ snapshot.last_seen_at | timeago }}
{% endif %}
@@ -28,7 +28,7 @@
{{ (profile and profile.persona_name) or session.name_at_join }}
- joined {{ ((now - session.joined_at).total_seconds() // 60) | int }}m ago
+ joined {{ session.joined_at | timeago }}
· ping {{ session.min_ping }}-{{ session.max_ping }}ms
@@ -52,7 +52,7 @@
{{ row.persona_name or row.name_at_join }}
- last seen {{ ((now - row.last_seen).total_seconds() // 60) | int }}m ago
+ last seen {{ row.last_seen | timeago }}
{% endfor %}