aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates/sent_webmention_detail.html
diff options
context:
space:
mode:
Diffstat (limited to 'webmentions_ssg/templates/sent_webmention_detail.html')
-rw-r--r--webmentions_ssg/templates/sent_webmention_detail.html176
1 files changed, 176 insertions, 0 deletions
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 @@
+<!--
+SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
+
+SPDX-License-Identifier: BSD-3-Clause
+-->
+{% 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 %}
+ <div class="mb-3">
+ <a href="{{ url_for('webmentions.sent_source_detail', source_uuid=source.uuid, source_page=source_page, page=webmentions_page, **filters) }}">← Back to source Webmentions</a>
+ </div>
+ <div class="d-flex flex-wrap justify-content-between align-items-center gap-2 mb-4">
+ <h1 class="mb-0">Sent Webmention</h1>
+ {% set style = sent_status_presentation.get(webmention.status, {"badge_class": "text-bg-info", "label": "Pending"}) %}
+ <span class="badge fs-6 {{ style.badge_class }}">{{ style.label }}</span>
+ </div>
+ <section class="card mb-4" aria-labelledby="webmention-details-heading">
+ <div class="card-body">
+ <h2 class="h4 card-title mb-3" id="webmention-details-heading">Delivery details</h2>
+ <dl class="row mb-0">
+ <dt class="col-md-3">Source</dt>
+ <dd class="col-md-9 text-break">
+ <a href="{{ url_for('webmentions.sent_source_detail', source_uuid=source.uuid, source_page=source_page, page=webmentions_page, **filters) }}">{{ source.url }}</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">Link</dt>
+ <dd class="col-md-9">
+ {{ 'Linked' if webmention.linked else 'Removed' }}
+ </dd>
+ <dt class="col-md-3">Created</dt>
+ <dd class="col-md-9">
+ <time datetime="{{ webmention.created_at | utc_isoformat }}"
+ title="{{ webmention.created_at | utc_timestamp }}">{{ webmention.created_at | relative_time }}</time>
+ </dd>
+ <dt class="col-md-3">Revisions</dt>
+ <dd class="col-md-9">
+ 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 '—' }}
+ </dd>
+ <dt class="col-md-3">Attempts</dt>
+ <dd class="col-md-9">
+ {{ webmention.attempt_count }}
+ </dd>
+ {% if webmention.next_retry_at is not none and webmention.awaiting_processing %}
+ <dt class="col-md-3">Next retry</dt>
+ <dd class="col-md-9">
+ <time datetime="{{ webmention.next_retry_at | utc_isoformat }}"
+ title="{{ webmention.next_retry_at | utc_timestamp }}">{{ webmention.next_retry_at | relative_time }}</time>
+ </dd>
+ {% endif %}
+ <dt class="col-md-3">Last attempted</dt>
+ <dd class="col-md-9">
+ {% if webmention.last_attempted_at is not none %}
+ <time datetime="{{ webmention.last_attempted_at | utc_isoformat }}"
+ title="{{ webmention.last_attempted_at | utc_timestamp }}">{{ webmention.last_attempted_at | relative_time }}</time>
+{% else %}—{% endif %}
+ </dd>
+ <dt class="col-md-3">Last sent</dt>
+ <dd class="col-md-9">
+ {% if webmention.last_sent_at is not none %}
+ <time datetime="{{ webmention.last_sent_at | utc_isoformat }}"
+ title="{{ webmention.last_sent_at | utc_timestamp }}">{{ webmention.last_sent_at | relative_time }}</time>
+{% else %}—{% endif %}
+ </dd>
+ {% if webmention.webmention_endpoint is not none %}
+ <dt class="col-md-3">Endpoint</dt>
+ <dd class="col-md-9 text-break">
+ <a href="{{ webmention.webmention_endpoint }}">{{ webmention.webmention_endpoint }}</a>
+ </dd>
+ {% endif %}
+ {% if webmention.endpoint_response_status is not none %}
+ <dt class="col-md-3">Endpoint HTTP</dt>
+ <dd class="col-md-9">
+ {{ webmention.endpoint_response_status }}
+ </dd>
+ {% endif %}
+ {% if webmention.status_url is not none %}
+ <dt class="col-md-3">Status URL</dt>
+ <dd class="col-md-9 text-break">
+ {% if webmention.status_url | is_http_url %}<a href="{{ webmention.status_url }}">{{ webmention.status_url }}</a>{% else %}{{ webmention.status_url }}{% endif %}
+ </dd>
+ {% endif %}
+ {% if webmention.failure_reason %}
+ <dt class="col-md-3">Failure</dt>
+ <dd class="col-md-9">
+ {{ render_failure(webmention.failure_reason, "sent") }}
+ </dd>
+ {% endif %}
+ <dt class="col-md-3">Webmention ID</dt>
+ <dd class="col-md-9">
+ <code class="text-break">{{ webmention.uuid }}</code>
+ </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.resend_webmention', source_uuid=source.uuid, webmention_uuid=webmention.uuid, return_to='detail', source_page=source_page, page=webmentions_page, history_page=history.page, **filters) }}"
+ data-title="Resend Webmention?"
+ data-message="This Webmention will be queued again for delivery to {{ webmention.target }}."
+ data-confirm-label="Resend"
+ data-confirm-class="btn-primary">Resend</button>
+ </div>
+ <section aria-labelledby="status-history-heading">
+ <h2 class="h4 mb-3" id="status-history-heading">Delivery history</h2>
+ {% if history.items %}
+ <ol class="list-group mb-3">
+ {% for event in history.items %}
+ {% set event_style = sent_status_presentation.get(event.status, {"badge_class": "text-bg-info", "label": "Pending"}) %}
+ <li class="list-group-item">
+ <div class="d-flex flex-wrap align-items-center gap-2 mb-1">
+ <span class="badge {{ event_style.badge_class }}">{{ event_style.label }}</span>
+ <strong>{{ event.action }}</strong>
+ <time class="ms-auto text-body-secondary small"
+ datetime="{{ event.occurred_at | utc_isoformat }}"
+ title="{{ event.occurred_at | utc_timestamp }}">{{ event.occurred_at | relative_time }}</time>
+ </div>
+ <div class="small text-body-secondary">
+ Revision {{ event.revision }} · Attempt {{ event.attempt_count }}
+ {% if event.endpoint_response_status is not none %}· HTTP {{ event.endpoint_response_status }}{% endif %}
+ </div>
+ {% if event.failure_reason %}
+ <div class="small mt-2">{{ render_failure(event.failure_reason, "sent") }}</div>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ol>
+ {% if history.pages > 1 %}
+ <div class="mt-3">
+ {{ 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'
+ ) }}
+ </div>
+ {% endif %}
+ {% else %}
+ <p class="text-body-secondary">No delivery events have been recorded for this Webmention yet.</p>
+ {% endif %}
+ </section>
+ {% include "includes/confirmation_modal.html" %}
+{% endblock %}
+
+{% block scripts %}
+ {{ super() }}
+ <script src="{{ url_for('static', filename='js/confirmation-modal.js') }}"></script>
+{% endblock %}