diff options
| author | Dennis Fink | 2026-11-18 19:18:18 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-18 19:18:18 +0100 |
| commit | beb0131b089293512c2dab2243b9b2ff314e2387 (patch) | |
| tree | 2690eaa17c689a77bccdc1268e971a96ec0e368f /webmentions_ssg/templates/received_detail.html | |
| parent | e3e195ea07fd57288d32c842689ebed7fba636f0 (diff) | |
| download | webmentions-ssg-beb0131b089293512c2dab2243b9b2ff314e2387.tar.gz webmentions-ssg-beb0131b089293512c2dab2243b9b2ff314e2387.zip | |
feat(core): show relative timestamps
Add reusable UTC template filters backed by `humanize` so timestamps
render as relative ages while preserving machine-readable `<time
datetime>` values.
Keep exact UTC timestamps available in tooltips across dashboard,
received, sent, detail, and public status views.
Diffstat (limited to 'webmentions_ssg/templates/received_detail.html')
| -rw-r--r-- | webmentions_ssg/templates/received_detail.html | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/webmentions_ssg/templates/received_detail.html b/webmentions_ssg/templates/received_detail.html index 32d3e05..38830bf 100644 --- a/webmentions_ssg/templates/received_detail.html +++ b/webmentions_ssg/templates/received_detail.html @@ -58,11 +58,17 @@ SPDX-License-Identifier: BSD-3-Clause </dd> <dt class="col-md-3">Received</dt> <dd class="col-md-9"> - <time datetime="{{ webmention.created_at.isoformat() }}">{{ webmention.created_at.strftime("%Y-%m-%d %H:%M:%S") }} UTC</time> + <time datetime="{{ webmention.created_at | utc_isoformat }}" + title="{{ webmention.created_at | utc_timestamp }}"> + {{ webmention.created_at | relative_time }} + </time> </dd> <dt class="col-md-3">Last updated</dt> <dd class="col-md-9"> - <time datetime="{{ webmention.updated_at.isoformat() }}">{{ webmention.updated_at.strftime("%Y-%m-%d %H:%M:%S") }} UTC</time> + <time datetime="{{ webmention.updated_at | utc_isoformat }}" + title="{{ webmention.updated_at | utc_timestamp }}"> + {{ webmention.updated_at | relative_time }} + </time> </dd> <dt class="col-md-3">Recovery attempts</dt> <dd class="col-md-9"> @@ -128,8 +134,9 @@ SPDX-License-Identifier: BSD-3-Clause <span class="badge {{ event_style.badge }}">{{ event_style.label }}</span> <strong>{{ event.action }}</strong> <time class="ms-auto text-body-secondary small" - datetime="{{ event.occurred_at.isoformat() }}"> - {{ event.occurred_at.strftime("%Y-%m-%d %H:%M:%S") }} UTC + datetime="{{ event.occurred_at | utc_isoformat }}" + title="{{ event.occurred_at | utc_timestamp }}"> + {{ event.occurred_at | relative_time }} </time> </div> <div class="small text-body-secondary">Recovery attempts: {{ event.recovery_attempts }}</div> |
