aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates/received_detail.html
diff options
context:
space:
mode:
authorDennis Fink2026-11-17 19:43:04 +0100
committerDennis Fink2026-11-17 19:43:04 +0100
commit5e24e8307f650e72881f747661a2b6e52db15f2d (patch)
tree585b456b9439a17957e8633f566c0725bb9d8595 /webmentions_ssg/templates/received_detail.html
parent6d6d079a3a99d3d3a922a640b6925eb2adf044de (diff)
downloadwebmentions-ssg-5e24e8307f650e72881f747661a2b6e52db15f2d.tar.gz
webmentions-ssg-5e24e8307f650e72881f747661a2b6e52db15f2d.zip
feat(receiver): add Webmention detail and status history
Add an authenticated detail view with full failure information, timestamps, actions, public status links, and recorded lifecycle transitions. Persist verification and resubmission events, backfill existing rows during migration, and clean up history when received Webmentions are deleted.
Diffstat (limited to 'webmentions_ssg/templates/received_detail.html')
-rw-r--r--webmentions_ssg/templates/received_detail.html148
1 files changed, 148 insertions, 0 deletions
diff --git a/webmentions_ssg/templates/received_detail.html b/webmentions_ssg/templates/received_detail.html
new file mode 100644
index 0000000..091e2e4
--- /dev/null
+++ b/webmentions_ssg/templates/received_detail.html
@@ -0,0 +1,148 @@
+<!--
+SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
+
+SPDX-License-Identifier: BSD-3-Clause
+-->
+{% extends "base.html" %}
+
+{% set status_presentation = {
+ "received": {
+ "badge": "text-bg-info",
+ "label": "Pending"
+ },
+ "verifying": {
+ "badge": "text-bg-warning",
+ "label": "Verifying"
+ },
+ "verified": {
+ "badge": "text-bg-success",
+ "label": "Verified"
+ },
+ "failed": {
+ "badge": "text-bg-danger",
+ "label": "Declined (failed)"
+ },
+ "source_removed": {
+ "badge": "text-bg-danger",
+ "label": "Declined (source removed)"
+ }
+} %}
+
+{% block styles %}
+ {{ super() }}
+ <link rel="stylesheet"
+ href="{{ url_for('static', filename='styles/style.css') }}">
+{% endblock %}
+
+{% block content %}
+ <div class="mb-3">
+ <a href="{{ url_for('webmentions.received_list', page=page, **filters) }}">← Back to received Webmentions</a>
+ </div>
+ <div class="d-flex flex-wrap justify-content-between align-items-center gap-2 mb-4">
+ <h1 class="mb-0">Received Webmention</h1>
+ {% set style = status_presentation.get(webmention.status, {"badge": "text-bg-secondary", "label": "Unknown"}) %}
+ <span class="badge fs-6 {{ style.badge }}">{{ style.label }}</span>
+ </div>
+ <section aria-labelledby="mention-details-heading" class="card mb-4">
+ <div class="card-body">
+ <h2 id="mention-details-heading" class="h4 card-title mb-3">Details</h2>
+ <dl class="row mb-0">
+ <dt class="col-md-3">Source</dt>
+ <dd class="col-md-9 text-break">
+ <a href="{{ webmention.source }}">{{ webmention.source }}</a>
+ </dd>
+ <dt class="col-md-3">Target</dt>
+ <dd class="col-md-9 text-break">
+ <a href="{{ webmention.target }}">{{ webmention.target }}</a>
+ </dd>
+ <dt class="col-md-3">Received</dt>
+ <dd class="col-md-9">
+ <time datetime="{{ webmention.created_at.isoformat() }}">{{ webmention.created_at.strftime("%Y-%m-%d %H:%M:%S") }} UTC</time>
+ </dd>
+ <dt class="col-md-3">Last updated</dt>
+ <dd class="col-md-9">
+ <time datetime="{{ webmention.updated_at.isoformat() }}">{{ webmention.updated_at.strftime("%Y-%m-%d %H:%M:%S") }} UTC</time>
+ </dd>
+ <dt class="col-md-3">Recovery attempts</dt>
+ <dd class="col-md-9">
+ {{ webmention.recovery_attempts }} <span class="text-body-secondary small">(automatic stale-verification recoveries; resets when verification is explicitly reopened)</span>
+ </dd>
+ <dt class="col-md-3">Webmention ID</dt>
+ <dd class="col-md-9">
+ <code class="text-break">{{ webmention.uuid }}</code>
+ </dd>
+ <dt class="col-md-3">Public status</dt>
+ <dd class="col-md-9">
+ <a href="{{ url_for('webmentions.webmention_status', identifier=webmention.uuid, _external=True) }}">View public status page</a>
+ </dd>
+ <dt class="col-md-3">Failure reason</dt>
+ <dd class="col-md-9">
+ {% if webmention.failure_reason %}
+ <div class="text-break text-pre-formatted">{{ webmention.failure_reason }}</div>
+ {% else %}
+ <span class="text-body-secondary">None</span>
+ {% endif %}
+ </dd>
+ </dl>
+ </div>
+ </section>
+ <div class="d-flex flex-wrap gap-2 mb-4" aria-label="Webmention actions">
+ <button type="button"
+ 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, return_to='detail', page=page, **filters) }}"
+ data-title="Reverify webmention?"
+ data-message="The webmention will be fetched and verified again."
+ data-confirm-label="Reverify"
+ data-confirm-class="btn-primary">Reverify</button>
+ <button type="button"
+ class="btn btn-sm btn-warning"
+ data-bs-toggle="modal"
+ data-bs-target="#confirmation-modal"
+ data-action="{{ url_for('webmentions.block_received_source', webmention_uuid=webmention.uuid, return_to='detail', page=page, **filters) }}"
+ data-title="Block this source domain?"
+ data-message="Future Webmentions from this source hostname and its subdomains will be rejected."
+ data-confirm-label="Block domain"
+ data-confirm-class="btn-warning">Block this domain</button>
+ <button type="button"
+ 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=page, **filters) }}"
+ data-title="Delete webmention?"
+ data-message="This permanently deletes the webmention and cannot be undone."
+ data-confirm-label="Delete"
+ data-confirm-class="btn-danger">Delete</button>
+ </div>
+ <section aria-labelledby="status-history-heading">
+ <h2 class="h4 mb-3" id="status-history-heading">Status history</h2>
+ {% if history %}
+ <ol class="list-group list-group-numbered mb-3">
+ {% for event in history %}
+ {% set event_style = status_presentation.get(event.status, {"badge": "text-bg-secondary", "label": "Unknown"}) %}
+ <li class="list-group-item">
+ <div class="d-flex flex-wrap align-items-center gap-2 mb-1">
+ <span class="badge {{ event_style.badge }}">{{ event_style.label }}</span>
+ <strong>{{ event.action }}</strong>
+ <time class="ms-auto text-body-secondary small"
+ datetime="{{ event.occurred_at.isoformat() }}">{{ event.occurred_at.strftime("%Y-%m-%d %H:%M:%S") }} UTC</time>
+ </div>
+ <div class="small text-body-secondary">Recovery attempts: {{ event.recovery_attempts }}</div>
+ {% if event.failure_reason %}
+ <div class="mt-2 text-break text-pre-formatted">{{ event.failure_reason }}</div>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ol>
+ {% else %}
+ <p class="text-body-secondary">No historical transitions were recorded for this Webmention. Its current status appears above.</p>
+ {% endif %}
+ </section>
+ {% include "includes/confirmation_modal.html" %}
+{% endblock %}
+
+{% block scripts %}
+ {{ super() }}
+ <script src="{{ url_for('static', filename='js/confirmation-modal.js') }}"></script>
+{% endblock %}