aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates/sent_source.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/sent_source.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 'webmentions_ssg/templates/sent_source.html')
-rw-r--r--webmentions_ssg/templates/sent_source.html30
1 files changed, 18 insertions, 12 deletions
diff --git a/webmentions_ssg/templates/sent_source.html b/webmentions_ssg/templates/sent_source.html
index 6e34458..33e26a2 100644
--- a/webmentions_ssg/templates/sent_source.html
+++ b/webmentions_ssg/templates/sent_source.html
@@ -51,20 +51,23 @@ SPDX-License-Identifier: BSD-3-Clause
</dd>
<dt class="col-sm-2">Created at</dt>
<dd class="col-sm-4">
- <time datetime="{{ source.created_at.isoformat() }}">
- {{ source.created_at.strftime("%Y-%m-%d %H:%M:%S") }}
+ <time datetime="{{ source.created_at | utc_isoformat }}"
+ title="{{ source.created_at | utc_timestamp }}">
+ {{ source.created_at | relative_time }}
</time>
</dd>
<dt class="col-sm-2">Last seen at</dt>
<dd class="col-sm-4">
- <time datetime="{{ source.last_seen_at.isoformat() }}">
- {{ source.last_seen_at.strftime("%Y-%m-%d %H:%M:%S") }}
+ <time datetime="{{ source.last_seen_at | utc_isoformat }}"
+ title="{{ source.last_seen_at | utc_timestamp }}">
+ {{ source.last_seen_at | relative_time }}
</time>
</dd>
<dt class="col-sm-2">Revised at</dt>
<dd class="col-sm-4">
- <time datetime="{{ source.revised_at.isoformat() }}">
- {{ source.revised_at.strftime("%Y-%m-%d %H:%M:%S") }}
+ <time datetime="{{ source.revised_at | utc_isoformat }}"
+ title="{{ source.revised_at | utc_timestamp }}">
+ {{ source.revised_at | relative_time }}
</time>
</dd>
<dt class="col-sm-2">Deleted at</dt>
@@ -72,8 +75,9 @@ SPDX-License-Identifier: BSD-3-Clause
{% if source.deleted_at is none %}
N/A
{% else %}
- <time datetime="{{ source.deleted_at.isoformat() }}">
- {{ source.deleted_at.strftime("%Y-%m-%d %H:%M:%S") }}
+ <time datetime="{{ source.deleted_at | utc_isoformat }}"
+ title="{{ source.deleted_at | utc_timestamp }}">
+ {{ source.deleted_at | relative_time }}
</time>
{% endif %}
</dd>
@@ -169,8 +173,9 @@ SPDX-License-Identifier: BSD-3-Clause
<strong>Attempted:</strong>
<br>
{% if webmention.last_attempted_at is not none %}
- <time datetime="{{ webmention.last_attempted_at.isoformat() }}">
- {{ webmention.last_attempted_at.strftime("%Y-%m-%d %H:%M:%S") }}
+ <time datetime="{{ webmention.last_attempted_at | utc_isoformat }}"
+ title="{{ webmention.last_attempted_at | utc_timestamp }}">
+ {{ webmention.last_attempted_at | relative_time }}
</time>
{% else %}
—
@@ -180,8 +185,9 @@ SPDX-License-Identifier: BSD-3-Clause
<strong>Sent:</strong>
<br>
{% if webmention.last_sent_at is not none %}
- <time datetime="{{ webmention.last_sent_at.isoformat() }}">
- {{ webmention.last_sent_at.strftime("%Y-%m-%d %H:%M:%S") }}
+ <time datetime="{{ webmention.last_sent_at | utc_isoformat }}"
+ title="{{ webmention.last_sent_at | utc_timestamp }}">
+ {{ webmention.last_sent_at | relative_time }}
</time>
{% else %}
—