From b2b5429bcf008db357d9d65db77ba37f7af908a8 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Wed, 18 Nov 2026 21:13:34 +0100 Subject: feat(sender): add source list filters and sorting Add status, search, date, sorting, and page-size controls to the source list with validated query parameters and stable pagination. Preserve list context across source details, rescans, resends, and pagination, and surface failed and retrying delivery counts with retry deadlines. --- webmentions_ssg/templates/sent.html | 103 ++++++++++++++++++++++++++++++------ 1 file changed, 87 insertions(+), 16 deletions(-) (limited to 'webmentions_ssg/templates/sent.html') diff --git a/webmentions_ssg/templates/sent.html b/webmentions_ssg/templates/sent.html index d2a319d..6febdb9 100644 --- a/webmentions_ssg/templates/sent.html +++ b/webmentions_ssg/templates/sent.html @@ -7,6 +7,19 @@ SPDX-License-Identifier: BSD-3-Clause {% from "bootstrap5/pagination.html" import render_pagination %} +{% macro sortable_header(label, column, responsive_class="") %} + {% set active = sort_key == column %} + + + {{ label }} + {% if active %}{% endif %} + + +{% endmacro %} + {% block content %}

Sources

@@ -16,29 +29,72 @@ SPDX-License-Identifier: BSD-3-Clause class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#confirmation-modal" - data-action="{{ url_for('webmentions.rescan_sources') }}" + data-action="{{ url_for('webmentions.rescan_sources', page=sources.page, **filters) }}" data-title="Rescan sources?" data-message="All sources will be scanned again for changes and webmentions." data-confirm-label="Rescan" data-confirm-class="btn-primary">Rescan
+ {% if sources.items %}
- - - - - - - + {{ sortable_header('Status', 'status') }} + {{ sortable_header('Path', 'path') }} + {{ sortable_header('URL', 'url', 'd-none d-md-table-cell') }} + {{ sortable_header('Webmentions', 'webmentions') }} + {{ sortable_header('Revision', 'revision', 'd-none d-md-table-cell') }} + {{ sortable_header('Created', 'created', 'd-none d-md-table-cell') }} + {{ sortable_header('Last seen', 'last_seen', 'd-none d-md-table-cell') }} {% for source in sources %} + {% set statistics = namespace(sent=0, failed=0, retrying=0) %} + {% for webmention in source.sent_webmentions %} + {% if webmention.status == "sent" %} + {% set statistics.sent = statistics.sent + 1 %} + {% elif webmention.status == "failed" %} + {% set statistics.failed = statistics.failed + 1 %} + {% endif %} + {% if webmention.awaiting_processing and webmention.attempt_count > 0 and webmention.next_retry_at is not none %} + {% set statistics.retrying = statistics.retrying + 1 %} + {% endif %} + {% endfor %} {% if source.deleted_at is none %} {% set row_class = "table-success" %} {% set badge_class = "text-bg-success" %} @@ -49,13 +105,27 @@ SPDX-License-Identifier: BSD-3-Clause {% set status_text = "Deleted" %} {% endif %} + - + - {% endfor %}
PathURLWebmentionsRevisionCreatedLast seenStatus
+ {{ status_text }} + - {{ source.path }} + {{ source.path }} {{ source.url }} {{ source.sent_webmentions | length }} + {{ source.sent_webmentions | length }} Total + {% if statistics.sent %} + {{ statistics.sent }} sent + {% endif %} + {% if statistics.failed %} + {{ statistics.failed }} failed + {% endif %} + {% if statistics.retrying %} + {{ statistics.retrying }} awaiting retry + {% endif %} + {{ source.revision }} - {{ status_text }} -
{% if sources.pages > 1 %} -
{{ render_pagination(sources) }}
+
{{ render_pagination(sources, args=filters) }}
{% endif %} - {% include "includes/confirmation_modal.html" %} {% else %} -

No Webmention sources have been discovered yet.

+ {% if filters %} +

No sources match these filters.

+ {% else %} +

No Webmention sources have been discovered yet.

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