diff options
Diffstat (limited to '')
| -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 %} |
