diff options
| author | Dennis Fink | 2026-11-17 22:10:40 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-17 22:10:40 +0100 |
| commit | 63af533d98aac82b6d4f069b217d3e837285508d (patch) | |
| tree | 4ac11960f9676d3bb5a6f62204ef139862734209 /webmentions_ssg/templates/received_detail.html | |
| parent | acd1f42847786963fc4aaeed884c3091700c9e35 (diff) | |
| download | webmentions-ssg-63af533d98aac82b6d4f069b217d3e837285508d.tar.gz webmentions-ssg-63af533d98aac82b6d4f069b217d3e837285508d.zip | |
feat(receiver): explain received Webmention failures
Map known verification failures to human-readable explanations and show
suggested next steps only for receiver-controlled problems while
retaining raw reasons.
Return a specific validation error when targets are outside
`ALLOWED_TARGET_HOSTNAMES` and reuse the guidance for status history.
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/templates/received_detail.html | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/webmentions_ssg/templates/received_detail.html b/webmentions_ssg/templates/received_detail.html index 091e2e4..32d3e05 100644 --- a/webmentions_ssg/templates/received_detail.html +++ b/webmentions_ssg/templates/received_detail.html @@ -5,6 +5,7 @@ SPDX-License-Identifier: BSD-3-Clause --> {% extends "base.html" %} +{% from "includes/received_failure.html" import render_failure %} {% set status_presentation = { "received": { "badge": "text-bg-info", @@ -78,7 +79,7 @@ SPDX-License-Identifier: BSD-3-Clause <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> + {{ render_failure(webmention.failure_reason) }} {% else %} <span class="text-body-secondary">None</span> {% endif %} @@ -121,17 +122,21 @@ SPDX-License-Identifier: BSD-3-Clause <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> + <li class="list-group-item d-flex gap-2"> + <div class="flex-grow-1" style="min-width: 0;"> + <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">{{ render_failure(event.failure_reason) }}</div> + {% endif %} </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> |
