aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates/received.html
diff options
context:
space:
mode:
authorDennis Fink2026-11-18 19:18:18 +0100
committerDennis Fink2026-11-18 19:18:18 +0100
commitbeb0131b089293512c2dab2243b9b2ff314e2387 (patch)
tree2690eaa17c689a77bccdc1268e971a96ec0e368f /webmentions_ssg/templates/received.html
parente3e195ea07fd57288d32c842689ebed7fba636f0 (diff)
downloadwebmentions-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 '')
-rw-r--r--webmentions_ssg/templates/received.html17
1 files changed, 9 insertions, 8 deletions
diff --git a/webmentions_ssg/templates/received.html b/webmentions_ssg/templates/received.html
index 2edf881..8931601 100644
--- a/webmentions_ssg/templates/received.html
+++ b/webmentions_ssg/templates/received.html
@@ -194,8 +194,9 @@ SPDX-License-Identifier: BSD-3-Clause
<a href="{{ webmention.source }}">{{ webmention.source }}</a>
<div class="small mt-1 d-md-none">
Received
- <time datetime="{{ webmention.created_at.isoformat() }}">
- {{ webmention.created_at.strftime("%Y-%m-%d %H:%M:%S") }}
+ <time datetime="{{ webmention.created_at | utc_isoformat }}"
+ title="{{ webmention.created_at | utc_timestamp }}">
+ {{ webmention.created_at | relative_time }}
</time>
</div>
</td>
@@ -203,15 +204,15 @@ SPDX-License-Identifier: BSD-3-Clause
<a href="{{ webmention.target }}">{{ webmention.target }}</a>
</td>
<td class="text-nowrap d-none d-md-table-cell">
- <time datetime="{{ webmention.created_at.isoformat() }}"
- title="{{ webmention.created_at.strftime('%Y-%m-%d %H:%M:%S') }} UTC">
- {{ webmention.created_at.strftime("%Y-%m-%d %H:%M:%S") }}
+ <time datetime="{{ webmention.created_at | utc_isoformat }}"
+ title="{{ webmention.created_at | utc_timestamp }}">
+ {{ webmention.created_at | relative_time }}
</time>
</td>
<td class="text-nowrap d-none d-md-table-cell">
- <time datetime="{{ webmention.updated_at.isoformat() }}"
- title="{{ webmention.updated_at.strftime('%Y-%m-%d %H:%M:%S') }} UTC">
- {{ webmention.updated_at.strftime("%Y-%m-%d %H:%M:%S") }}
+ <time datetime="{{ webmention.updated_at | utc_isoformat }}"
+ title="{{ webmention.updated_at | utc_timestamp }}">
+ {{ webmention.updated_at | relative_time }}
</time>
</td>
<td>