From ef90dc381322122ecfb9af039cf790de92807514 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Sat, 21 Nov 2026 14:49:28 +0100 Subject: feat(sender): split source and delivery history Add per-Webmention detail pages so delivery state, failure guidance, status URLs, and delivery history no longer crowd the source overview. Track source lifecycle events separately for discovery, revision, deletion, and restoration, and add a source-level action to resend only failed Webmentions. --- webmentions_ssg/templates/moderation.html | 2 +- webmentions_ssg/templates/received.html | 8 +- webmentions_ssg/templates/sent.html | 37 ++-- webmentions_ssg/templates/sent_source.html | 227 ++++++--------------- .../templates/sent_webmention_detail.html | 176 ++++++++++++++++ 5 files changed, 253 insertions(+), 197 deletions(-) create mode 100644 webmentions_ssg/templates/sent_webmention_detail.html (limited to 'webmentions_ssg/templates') diff --git a/webmentions_ssg/templates/moderation.html b/webmentions_ssg/templates/moderation.html index 3c1e549..2fd922b 100644 --- a/webmentions_ssg/templates/moderation.html +++ b/webmentions_ssg/templates/moderation.html @@ -54,7 +54,7 @@ SPDX-License-Identifier: BSD-3-Clause method="post"> + class="btn btn-sm btn-danger">{{ "Unblock" if kind == "blocked" else "Remove" }} diff --git a/webmentions_ssg/templates/received.html b/webmentions_ssg/templates/received.html index e7ec5a8..323475a 100644 --- a/webmentions_ssg/templates/received.html +++ b/webmentions_ssg/templates/received.html @@ -81,7 +81,7 @@ SPDX-License-Identifier: BSD-3-Clause
Clear + class="btn btn-secondary">Clear
0 selected
Clear + class="btn btn-secondary">Clear
-
+
-

Details

+

Source details

-
Source ID
-
- {{ source.uuid }} -
-
Content hash
-
- {{ source.content_hash }} -
Path
{{ source.path }} @@ -57,46 +45,53 @@ SPDX-License-Identifier: BSD-3-Clause
{{ source.url }}
+
Revision
+
+ {{ source.revision }} +
Created
+ title="{{ source.created_at | utc_timestamp }}">{{ source.created_at | relative_time }}
Last seen
+ title="{{ source.last_seen_at | utc_timestamp }}">{{ source.last_seen_at | relative_time }}
-
Revised
+
Last revised
+ title="{{ source.revised_at | utc_timestamp }}">{{ source.revised_at | relative_time }}
-
Deleted
-
- {% if source.deleted_at is none %} - Never - {% else %} + {% if source.deleted_at is not none %} +
Deleted
+
- {% endif %} + title="{{ source.deleted_at | utc_timestamp }}">{{ source.deleted_at | relative_time }} +
+ {% endif %} +
Source ID
+
+ {{ source.uuid }}
-
Revision
+
Content hash
- {{ source.revision }} + {{ source.content_hash }}
+ + Details {% endfor %} @@ -247,35 +157,18 @@ SPDX-License-Identifier: BSD-3-Clause

No Webmentions have been discovered for this source.

{% endif %} -
-

Status history

+
+

Source history

{% if history.items %} -
    +
      {% for event in history.items %} - {% set style = sent_status_presentation.get(event.status, {"badge_class": "text-bg-info", "label": "Pending"}) %} -
    1. -
      -
      - {{ style.label }} - {{ event.action }} - -
      - -
      - Revision {{ event.revision }} · Attempt {{ event.attempt_count }} - {% if event.endpoint_response_status is not none %} - · HTTP {{ event.endpoint_response_status }} - {% endif %} -
      - {% if event.failure_reason %} -
      {{ render_failure(event.failure_reason, "sent") }}
      - {% endif %} +
    2. +
      + {{ event.action }} + Revision {{ event.revision }} +
    3. {% endfor %} @@ -291,12 +184,12 @@ SPDX-License-Identifier: BSD-3-Clause source_page=source_page if source_page > 1 else none, webmentions_page=webmentions.page if webmentions.page > 1 else none ), - fragment='status-history-heading' + fragment='source-history-heading' ) }}
{% endif %} {% else %} -

No historical delivery events were recorded for this source. Current Webmention statuses appear above.

+

No source lifecycle events have been recorded yet. Delivery history is available on each Webmention's detail page.

{% endif %} {% include "includes/confirmation_modal.html" %} diff --git a/webmentions_ssg/templates/sent_webmention_detail.html b/webmentions_ssg/templates/sent_webmention_detail.html new file mode 100644 index 0000000..fc7d7a4 --- /dev/null +++ b/webmentions_ssg/templates/sent_webmention_detail.html @@ -0,0 +1,176 @@ + +{% extends "base.html" %} + +{% from "bootstrap5/pagination.html" import render_pagination %} +{% from "includes/failure_guidance.html" import render_failure %} +{% set sent_status_presentation = { + "sent": { + "badge_class": "text-bg-success", + "label": "Sent" + }, + "no_endpoint": { + "badge_class": "text-bg-warning", + "label": "Unsupported" + }, + "failed": { + "badge_class": "text-bg-danger", + "label": "Failed" + } +} %} + +{% block content %} +
+ ← Back to source Webmentions +
+
+

Sent Webmention

+ {% set style = sent_status_presentation.get(webmention.status, {"badge_class": "text-bg-info", "label": "Pending"}) %} + {{ style.label }} +
+
+
+

Delivery details

+
+
Source
+
+ {{ source.url }} +
+
Target
+
+ {{ webmention.target }} +
+
Link
+
+ {{ 'Linked' if webmention.linked else 'Removed' }} +
+
Created
+
+ +
+
Revisions
+
+ Desired {{ webmention.desired_revision }} · Processed {{ webmention.processed_revision if webmention.processed_revision is not none else '—' }} · Sent {{ webmention.sent_revision if webmention.sent_revision is not none else '—' }} +
+
Attempts
+
+ {{ webmention.attempt_count }} +
+ {% if webmention.next_retry_at is not none and webmention.awaiting_processing %} +
Next retry
+
+ +
+ {% endif %} +
Last attempted
+
+ {% if webmention.last_attempted_at is not none %} + +{% else %}—{% endif %} +
+
Last sent
+
+ {% if webmention.last_sent_at is not none %} + +{% else %}—{% endif %} +
+ {% if webmention.webmention_endpoint is not none %} +
Endpoint
+
+ {{ webmention.webmention_endpoint }} +
+ {% endif %} + {% if webmention.endpoint_response_status is not none %} +
Endpoint HTTP
+
+ {{ webmention.endpoint_response_status }} +
+ {% endif %} + {% if webmention.status_url is not none %} +
Status URL
+
+ {% if webmention.status_url | is_http_url %}{{ webmention.status_url }}{% else %}{{ webmention.status_url }}{% endif %} +
+ {% endif %} + {% if webmention.failure_reason %} +
Failure
+
+ {{ render_failure(webmention.failure_reason, "sent") }} +
+ {% endif %} +
Webmention ID
+
+ {{ webmention.uuid }} +
+
+
+
+
+ +
+
+

Delivery history

+ {% if history.items %} +
    + {% for event in history.items %} + {% set event_style = sent_status_presentation.get(event.status, {"badge_class": "text-bg-info", "label": "Pending"}) %} +
  1. +
    + {{ event_style.label }} + {{ event.action }} + +
    +
    + Revision {{ event.revision }} · Attempt {{ event.attempt_count }} + {% if event.endpoint_response_status is not none %}· HTTP {{ event.endpoint_response_status }}{% endif %} +
    + {% if event.failure_reason %} +
    {{ render_failure(event.failure_reason, "sent") }}
    + {% endif %} +
  2. + {% endfor %} +
+ {% if history.pages > 1 %} +
+ {{ render_pagination( + history, + endpoint='webmentions.sent_webmention_history_pagination', + args=dict( + filters, + source_uuid=source.uuid, + webmention_uuid=webmention.uuid, + source_page=source_page if source_page > 1 else none, + webmentions_page=webmentions_page if webmentions_page > 1 else none + ), + fragment='status-history-heading' + ) }} +
+ {% endif %} + {% else %} +

No delivery events have been recorded for this Webmention yet.

+ {% endif %} +
+ {% include "includes/confirmation_modal.html" %} +{% endblock %} + +{% block scripts %} + {{ super() }} + +{% endblock %} -- cgit v1.3.1