1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
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 %}
|