aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates/received.html
diff options
context:
space:
mode:
authorDennis Fink2026-11-16 22:59:36 +0100
committerDennis Fink2026-11-16 22:59:36 +0100
commitf98b0e446b41325c494bd97900b7bbf730a7d67e (patch)
treea2a3c1e8779877d420d1685862f40b93d647c8f8 /webmentions_ssg/templates/received.html
parent354a5b449077478b141683bafbab47c9dc169d21 (diff)
downloadwebmentions-ssg-f98b0e446b41325c494bd97900b7bbf730a7d67e.tar.gz
webmentions-ssg-f98b0e446b41325c494bd97900b7bbf730a7d67e.zip
feat(receiver): add bulk received Webmention actions
Allow admins to select received Webmentions for bulk reverification or deletion and provide a separate action to delete all declined entries. Validate selections strictly, preserve active list filters across redirects, and reuse the shared confirmation modal with CSRF protection.
Diffstat (limited to '')
-rw-r--r--webmentions_ssg/templates/received.html55
1 files changed, 54 insertions, 1 deletions
diff --git a/webmentions_ssg/templates/received.html b/webmentions_ssg/templates/received.html
index 8cd952c..de3a9b6 100644
--- a/webmentions_ssg/templates/received.html
+++ b/webmentions_ssg/templates/received.html
@@ -108,10 +108,56 @@ SPDX-License-Identifier: BSD-3-Clause
class="btn btn-outline-secondary">Clear</a>
</div>
</form>
+ <div class="d-flex flex-wrap align-items-center gap-2 mb-3"
+ aria-label="Received Webmention actions">
+ {% if webmentions.items %}
+ <span id="received-selected-count"
+ class="text-body-secondary"
+ role="status"
+ aria-live="polite">0 selected</span>
+ <button type="button"
+ class="btn btn-sm btn-outline-primary"
+ disabled
+ data-bs-toggle="modal"
+ data-bs-target="#confirmation-modal"
+ data-received-bulk-action="reverify"
+ data-action="{{ url_for('webmentions.reverify_selected_received_webmentions', page=webmentions.page, **filters) }}"
+ data-title="Reverify selected webmentions?"
+ data-message="All selected webmentions will be fetched and verified again."
+ data-confirm-label="Reverify selected"
+ data-confirm-class="btn-primary">Reverify selected</button>
+ <button type="button"
+ class="btn btn-sm btn-outline-danger"
+ disabled
+ data-bs-toggle="modal"
+ data-bs-target="#confirmation-modal"
+ data-received-bulk-action="delete"
+ data-action="{{ url_for('webmentions.delete_selected_received_webmentions', page=webmentions.page, **filters) }}"
+ data-title="Delete selected webmentions?"
+ data-message="This permanently deletes all selected webmentions and cannot be undone."
+ data-confirm-label="Delete selected"
+ data-confirm-class="btn-danger">Delete selected</button>
+ {% endif %}
+ <button type="button"
+ class="btn btn-sm btn-danger ms-auto"
+ data-bs-toggle="modal"
+ data-bs-target="#confirmation-modal"
+ data-action="{{ url_for('webmentions.delete_all_declined_received_webmentions', page=webmentions.page, **filters) }}"
+ data-title="Delete all declined webmentions?"
+ data-message="This permanently deletes all declined webmentions across every page, without waiting for automatic retention, regardless of the current filters. This cannot be undone."
+ data-confirm-label="Delete all declined"
+ data-confirm-class="btn-danger">Delete all declined</button>
+ </div>
{% if webmentions.items %}
<table class="table table-bordered table-striped table-hover align-middle">
<thead>
<tr>
+ <th scope="col">
+ <input type="checkbox"
+ class="form-check-input"
+ id="received-select-all"
+ aria-label="Select all Webmentions on this page">
+ </th>
{{ sortable_header('Status', 'status') }}
{{ sortable_header('Source', 'source') }}
{{ sortable_header('Target', 'target') }}
@@ -125,6 +171,12 @@ SPDX-License-Identifier: BSD-3-Clause
{% for webmention in webmentions %}
{% set style = received_status_presentation.get(webmention.status, {"row_class": "table-danger", "badge_class": "text-bg-danger", "label": "Declined"}) %}
<tr class="{{ style.row_class }}">
+ <td>
+ <input type="checkbox"
+ class="form-check-input received-select"
+ value="{{ webmention.uuid }}"
+ aria-label="Select webmention {{ webmention.uuid }}">
+ </td>
<td><span class="badge {{ style.badge_class }}">{{ style.label }}</span></td>
<td class="text-break">
<a href="{{ webmention.source }}">{{ webmention.source }}</a>
@@ -170,7 +222,6 @@ SPDX-License-Identifier: BSD-3-Clause
{% if webmentions.pages > 1 %}
<div class="mt-3">{{ render_pagination(webmentions, args=filters) }}</div>
{% endif %}
- {% include "includes/confirmation_modal.html" %}
{% else %}
{% if filters %}
<p class="text-body-secondary">No Webmentions match these filters.</p>
@@ -178,9 +229,11 @@ SPDX-License-Identifier: BSD-3-Clause
<p class="text-body-secondary">No Webmentions have been received yet.</p>
{% endif %}
{% endif %}
+ {% include "includes/confirmation_modal.html" %}
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{ url_for('static', filename='js/confirmation-modal.js') }}"></script>
+ <script src="{{ url_for('static', filename='js/received-bulk-actions.js') }}"></script>
{% endblock %}