diff options
| author | Dennis Fink | 2026-08-16 20:51:26 +0200 |
|---|---|---|
| committer | Dennis Fink | 2026-08-16 20:51:26 +0200 |
| commit | 85a73c811a3de333138978d8d450533caa668dc5 (patch) | |
| tree | 6b8b855484c14a7934922d91d4bfd7ececd099eb | |
| parent | 58a4a8ee06bcf23c3957af5c2ea035b6797c4395 (diff) | |
| download | webmentions-ssg-85a73c811a3de333138978d8d450533caa668dc5.tar.gz webmentions-ssg-85a73c811a3de333138978d8d450533caa668dc5.zip | |
feat(sender): improve sent webmention status display
Highlight source and Webmention rows based on their current state and
use badges for clearer status and activity indicators.
Make discovered endpoints and status URLs clickable in the detail view.
| -rw-r--r-- | webmentions_ssg/templates/sent.html | 17 | ||||
| -rw-r--r-- | webmentions_ssg/templates/sent_source.html | 63 |
2 files changed, 53 insertions, 27 deletions
diff --git a/webmentions_ssg/templates/sent.html b/webmentions_ssg/templates/sent.html index 69a91d8..4993bef 100644 --- a/webmentions_ssg/templates/sent.html +++ b/webmentions_ssg/templates/sent.html @@ -21,7 +21,16 @@ </thead> <tbody> {% for source in sources %} - <tr> + {% if source.deleted_at is none %} + {% set row_class = "table-success" %} + {% set badge_class = "text-bg-success" %} + {% set status_text = "Active" %} + {% else %} + {% set row_class = "table-danger" %} + {% set badge_class = "text-bg-danger" %} + {% set status_text = "Deleted" %} + {% endif %} + <tr class="{{ row_class }}"> <td class="text-nowrap"> <a href="{{ url_for('root.sent_source', identifier=source.uuid) }}">{{ source.path }}</a> </td> @@ -41,11 +50,7 @@ </time> </td> <td> - {% if source.deleted_at is none %} - <span class="badge text-bg-success">Active</span> - {% else %} - <span class="badge text-bg-danger">Deleted</span> - {% endif %} + <span class="badge {{ badge_class }}">{{ status_text }}</span> </td> </tr> {% endfor %} diff --git a/webmentions_ssg/templates/sent_source.html b/webmentions_ssg/templates/sent_source.html index 6d397f2..8e5932c 100644 --- a/webmentions_ssg/templates/sent_source.html +++ b/webmentions_ssg/templates/sent_source.html @@ -77,54 +77,75 @@ <th scope="col">Endpoint</th> <th scope="col">Response Status</th> <th scope="col">Status URL</th> - <th scope="col">Last Attempted at</th> - <th scope="col">Last Sent at</th> + <th scope="col">Last attempted at</th> + <th scope="col">Last sent at</th> </tr> </thead> <tbody> {% for webmention in webmentions %} - <tr> + {% if webmention.status.value == "sent" %} + {% set row_class = "table-success" %} + {% set badge_class = "text-bg-success" %} + {% elif webmention.status.value == "unsupported" %} + {% set row_class = "table-warning" %} + {% set badge_class = "text-bg-warning" %} + {% elif webmention.status.value == "failed" %} + {% set row_class = "table-danger" %} + {% set badge_class = "text-bg-danger" %} + {% else %} + {% set row_class = "table-info" %} + {% set badge_class = "text-bg-info" %} + {% endif %} + <tr class="{{ row_class }}"> <td class="text-break"> <a href="{{ webmention.target }}">{{ webmention.target }}</a> </td> - <td>{{ webmention.status.value }}</td> + <td> + {% if webmention.status is not none %} + <span class="badge {{ badge_class }}">{{ webmention.status.value.title() }}</span> + {% endif %} + </td> <td> {% if webmention.active %} <span class="badge text-bg-success">Active</span> {% else %} - <span class="badge text-bg-secondary">Removed</span> + <span class="badge text-bg-danger">Removed</span> {% endif %} </td> <td>{{ webmention.desired_revision }}</td> <td> {{ webmention.processed_revision - if webmention.processed_revision is not none - else "—" }} + if webmention.processed_revision is not none + else "—" }} </td> <td> {{ webmention.sent_revision - if webmention.sent_revision is not none - else "—" }} + if webmention.sent_revision is not none + else "—" }} </td> <td> {{ webmention.failure_reason - if webmention.failure_reason is not none - else "—" }} + if webmention.failure_reason is not none + else "—" }} </td> - <td> - {{ webmention.endpoint - if webmention.endpoint is not none - else "—" }} + <td class="text-break"> + {% if webmention.endpoint is not none %} + <a href="{{ webmention.endpoint }}">{{ webmention.endpoint }}</a> + {% else %} + — + {% endif %} </td> <td> {{ webmention.response_status - if webmention.response_status is not none - else "—" }} + if webmention.response_status is not none + else "—" }} </td> - <td> - {{ webmention.status_url - if webmention.status_url is not none - else "—" }} + <td class="text-break"> + {% if webmention.status_url is not none %} + <a href="{{ webmention.status_url }}">{{ webmention.status_url }}</a> + {% else %} + — + {% endif %} </td> <td> {% if webmention.last_attempted_at is not none %} |
