diff options
| author | Dennis Fink | 2026-11-16 17:58:36 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-16 17:58:36 +0100 |
| commit | f7d846b66ae4286518ecc20537ba19c5afadf7f4 (patch) | |
| tree | b72e509875dccf21b43f83b92c4aa017df0de37b /webmentions_ssg/templates/received.html | |
| parent | 09353e2fd7a66987076f33f65ac4f0fc8831e887 (diff) | |
| download | webmentions-ssg-f7d846b66ae4286518ecc20537ba19c5afadf7f4.tar.gz webmentions-ssg-f7d846b66ae4286518ecc20537ba19c5afadf7f4.zip | |
feat(receiver): add received Webmention filters
Add status, URL search, and updated-date filters to the received
Webmention list with strict query validation and inclusive UTC date
ranges.
Preserve active filters across pagination, delete, and reverify actions.
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/templates/received.html | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/webmentions_ssg/templates/received.html b/webmentions_ssg/templates/received.html index f94d104..9034ca8 100644 --- a/webmentions_ssg/templates/received.html +++ b/webmentions_ssg/templates/received.html @@ -39,6 +39,32 @@ SPDX-License-Identifier: BSD-3-Clause <h1 class="mb-0">Received Webmentions</h1> <span class="text-body-secondary">{{ webmentions.total }} total</span> </div> + <form action="{{ url_for('webmentions.received_list') }}" + method="get" + class="row g-2 align-items-end mb-4" + role="search"> + <div class="col-sm-6 col-lg"> + {{ filter_form.status.label(class="form-label") }} + {{ filter_form.status(class="form-select") }} + </div> + <div class="col-sm-6 col-lg"> + {{ filter_form.q.label(class="form-label") }} + {{ filter_form.q(class="form-control", placeholder="Search URLs") }} + </div> + <div class="col-sm-6 col-lg"> + {{ filter_form.date_from.label(class="form-label") }} + {{ filter_form.date_from(class="form-control") }} + </div> + <div class="col-sm-6 col-lg"> + {{ filter_form.date_to.label(class="form-label") }} + {{ filter_form.date_to(class="form-control") }} + </div> + <div class="col-auto d-flex gap-2 ms-auto"> + <button type="submit" class="btn btn-primary">Filter</button> + <a href="{{ url_for('webmentions.received_list') }}" + class="btn btn-outline-secondary">Clear</a> + </div> + </form> {% if webmentions.items %} <table class="table table-bordered table-striped table-hover align-middle"> <thead> @@ -79,7 +105,7 @@ 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.reverify_received_webmention', webmention_uuid=webmention.uuid, page=webmentions.page) }}" + data-action="{{ url_for('webmentions.reverify_received_webmention', webmention_uuid=webmention.uuid, page=webmentions.page, **filters) }}" data-title="Reverify webmention?" data-message="The webmention will be fetched and verified again." data-confirm-label="Reverify" @@ -88,7 +114,7 @@ SPDX-License-Identifier: BSD-3-Clause class="btn btn-sm btn-danger" data-bs-toggle="modal" data-bs-target="#confirmation-modal" - data-action="{{ url_for('webmentions.delete_received_webmention', webmention_uuid=webmention.uuid, page=webmentions.page) }}" + data-action="{{ url_for('webmentions.delete_received_webmention', webmention_uuid=webmention.uuid, page=webmentions.page, **filters) }}" data-title="Delete webmention?" data-message="This permanently deletes the webmention and cannot be undone." data-confirm-label="Delete" @@ -99,11 +125,15 @@ SPDX-License-Identifier: BSD-3-Clause </tbody> </table> {% if webmentions.pages > 1 %} - <div class="mt-3">{{ render_pagination(webmentions) }}</div> + <div class="mt-3">{{ render_pagination(webmentions, args=filters) }}</div> {% endif %} {% include "includes/confirmation_modal.html" %} {% else %} - <p class="text-body-secondary">No Webmentions have been received yet.</p> + {% if filters %} + <p class="text-body-secondary">No Webmentions match these filters.</p> + {% else %} + <p class="text-body-secondary">No Webmentions have been received yet.</p> + {% endif %} {% endif %} {% endblock %} |
