diff options
| -rw-r--r-- | webmentions_ssg/templates/received.html | 144 | ||||
| -rw-r--r-- | webmentions_ssg/templates/sent.html | 98 |
2 files changed, 119 insertions, 123 deletions
diff --git a/webmentions_ssg/templates/received.html b/webmentions_ssg/templates/received.html index 7cfdce8..2feef1e 100644 --- a/webmentions_ssg/templates/received.html +++ b/webmentions_ssg/templates/received.html @@ -11,80 +11,78 @@ SPDX-License-Identifier: BSD-3-Clause <span class="text-body-secondary">{{ webmentions.total }} total</span> </div> {% if webmentions.items %} - <div class="table-responsive"> - <table class="table table-bordered table-striped table-hover align-middle"> - <thead> - <tr> - <th scope="col">Status</th> - <th scope="col">Source</th> - <th scope="col">Target</th> - <th scope="col">Received</th> - <th scope="col">Updated</th> - <th scope="col">Reason</th> - <th scope="col">Actions</th> + <table class="table table-bordered table-striped table-hover align-middle"> + <thead> + <tr> + <th scope="col">Status</th> + <th scope="col">Source</th> + <th scope="col">Target</th> + <th scope="col">Received</th> + <th scope="col">Updated</th> + <th scope="col">Reason</th> + <th scope="col">Actions</th> + </tr> + </thead> + <tbody> + {% for webmention in webmentions %} + {% if webmention.status == "received" %} + {% set row_class = "table-info" %} + {% set display_status = "Pending" %} + {% elif webmention.status == "verifying" %} + {% set row_class = "table-warning" %} + {% set display_status = "Verifying" %} + {% elif webmention.status == "verified" %} + {% set row_class = "table-success" %} + {% set display_status = "Verified" %} + {% else %} + {% set row_class = "table-danger" %} + {% set display_status = "Declined" %} + {% endif %} + <tr class="{{ row_class }}"> + <td> + <strong>{{ display_status }}</strong> + </td> + <td class="text-break"> + <a href="{{ webmention.source }}">{{ webmention.source }}</a> + </td> + <td class="text-break"> + <a href="{{ webmention.target }}">{{ webmention.target }}</a> + </td> + <td class="text-nowrap"> + <time datetime="{{ webmention.created_at.isoformat() }}"> + {{ webmention.created_at.strftime("%Y-%m-%d %H:%M:%S") }} + </time> + </td> + <td class="text-nowrap"> + <time datetime="{{ webmention.updated_at.isoformat() }}"> + {{ webmention.updated_at.strftime("%Y-%m-%d %H:%M:%S") }} + </time> + </td> + <td>{{ webmention.failure_reason or "—" }}</td> + <td class="text-nowrap"> + <button type="button" + class="btn btn-sm btn-primary" + data-bs-toggle="modal" + data-bs-target="#confirmation-modal" + data-action="{{ url_for('root.reverify_received_webmention', identifier=webmention.uuid, page=webmentions.page) }}" + data-title="Reverify webmention?" + data-message="The webmention will be fetched and verified again." + data-confirm-label="Reverify" + data-confirm-class="btn-primary">Reverify</button> + <button type="button" + class="btn btn-sm btn-danger" + data-bs-toggle="modal" + data-bs-target="#confirmation-modal" + data-action="{{ url_for('root.delete_received_webmention', identifier=webmention.uuid, page=webmentions.page) }}" + data-title="Delete webmention?" + data-message="This permanently deletes the webmention and cannot be undone." + data-confirm-label="Delete" + data-confirm-class="btn-danger">Delete</button> + </td> </tr> - </thead> - <tbody> - {% for webmention in webmentions %} - {% if webmention.status == "received" %} - {% set row_class = "table-info" %} - {% set display_status = "Pending" %} - {% elif webmention.status == "verifying" %} - {% set row_class = "table-warning" %} - {% set display_status = "Verifying" %} - {% elif webmention.status == "verified" %} - {% set row_class = "table-success" %} - {% set display_status = "Verified" %} - {% else %} - {% set row_class = "table-danger" %} - {% set display_status = "Declined" %} - {% endif %} - <tr class="{{ row_class }}"> - <td> - <strong>{{ display_status }}</strong> - </td> - <td class="text-break"> - <a href="{{ webmention.source }}">{{ webmention.source }}</a> - </td> - <td class="text-break"> - <a href="{{ webmention.target }}">{{ webmention.target }}</a> - </td> - <td class="text-nowrap"> - <time datetime="{{ webmention.created_at.isoformat() }}"> - {{ webmention.created_at.strftime("%Y-%m-%d %H:%M:%S") }} - </time> - </td> - <td class="text-nowrap"> - <time datetime="{{ webmention.updated_at.isoformat() }}"> - {{ webmention.updated_at.strftime("%Y-%m-%d %H:%M:%S") }} - </time> - </td> - <td>{{ webmention.failure_reason or "—" }}</td> - <td class="text-nowrap"> - <button type="button" - class="btn btn-sm btn-primary" - data-bs-toggle="modal" - data-bs-target="#confirmation-modal" - data-action="{{ url_for('root.reverify_received_webmention', identifier=webmention.uuid, page=webmentions.page) }}" - data-title="Reverify webmention?" - data-message="The webmention will be fetched and verified again." - data-confirm-label="Reverify" - data-confirm-class="btn-primary">Reverify</button> - <button type="button" - class="btn btn-sm btn-danger" - data-bs-toggle="modal" - data-bs-target="#confirmation-modal" - data-action="{{ url_for('root.delete_received_webmention', identifier=webmention.uuid, page=webmentions.page) }}" - data-title="Delete webmention?" - data-message="This permanently deletes the webmention and cannot be undone." - data-confirm-label="Delete" - data-confirm-class="btn-danger">Delete</button> - </td> - </tr> - {% endfor %} - </tbody> - </table> - </div> + {% endfor %} + </tbody> + </table> {% if webmentions.pages > 1 %} <div class="mt-3">{{ render_pagination(webmentions) }}</div> {% endif %} diff --git a/webmentions_ssg/templates/sent.html b/webmentions_ssg/templates/sent.html index 4ca75ce..844a243 100644 --- a/webmentions_ssg/templates/sent.html +++ b/webmentions_ssg/templates/sent.html @@ -22,57 +22,55 @@ SPDX-License-Identifier: BSD-3-Clause </div> </div> {% if sources.items %} - <div class="table-responsive"> - <table class="table table-bordered table-striped table-hover align-middle"> - <thead> - <tr> - <th scope="col">Path</th> - <th scope="col">URL</th> - <th scope="col">Webmentions</th> - <th scope="col">Revision</th> - <th scope="col">Created</th> - <th scope="col">Last seen</th> - <th scope="col">Status</th> + <table class="table table-bordered table-striped table-hover align-middle"> + <thead> + <tr> + <th scope="col">Path</th> + <th scope="col">URL</th> + <th scope="col">Webmentions</th> + <th scope="col">Revision</th> + <th scope="col">Created</th> + <th scope="col">Last seen</th> + <th scope="col">Status</th> + </tr> + </thead> + <tbody> + {% for source in sources %} + {% 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', source_identifier=source.uuid) }}">{{ source.path }}</a> + </td> + <td class="text-break"> + <a href="{{ source.url }}">{{ source.url }}</a> + </td> + <td>{{ source.sent_webmentions | length }}</td> + <td>{{ source.revision }}</td> + <td class="text-nowrap"> + <time datetime="{{ source.created_at.isoformat() }}"> + {{ source.created_at.strftime("%Y-%m-%d %H:%M:%S") }} + </time> + </td> + <td class="text-nowrap"> + <time datetime="{{ source.last_seen_at.isoformat() }}"> + {{ source.last_seen_at.strftime("%Y-%m-%d %H:%M:%S") }} + </time> + </td> + <td> + <span class="badge {{ badge_class }}">{{ status_text }}</span> + </td> </tr> - </thead> - <tbody> - {% for source in sources %} - {% 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', source_identifier=source.uuid) }}">{{ source.path }}</a> - </td> - <td class="text-break"> - <a href="{{ source.url }}">{{ source.url }}</a> - </td> - <td>{{ source.sent_webmentions | length }}</td> - <td>{{ source.revision }}</td> - <td class="text-nowrap"> - <time datetime="{{ source.created_at.isoformat() }}"> - {{ source.created_at.strftime("%Y-%m-%d %H:%M:%S") }} - </time> - </td> - <td class="text-nowrap"> - <time datetime="{{ source.last_seen_at.isoformat() }}"> - {{ source.last_seen_at.strftime("%Y-%m-%d %H:%M:%S") }} - </time> - </td> - <td> - <span class="badge {{ badge_class }}">{{ status_text }}</span> - </td> - </tr> - {% endfor %} - </tbody> - </table> - </div> + {% endfor %} + </tbody> + </table> {% if sources.pages > 1 %} <div class="mt-3">{{ render_pagination(sources) }}</div> {% endif %} |
