diff options
Diffstat (limited to 'webmentions_ssg')
| -rw-r--r-- | webmentions_ssg/templates/dashboard.html | 4 | ||||
| -rw-r--r-- | webmentions_ssg/templates/received.html | 35 | ||||
| -rw-r--r-- | webmentions_ssg/templates/sent.html | 98 | ||||
| -rw-r--r-- | webmentions_ssg/templates/sent_source.html | 215 |
4 files changed, 180 insertions, 172 deletions
diff --git a/webmentions_ssg/templates/dashboard.html b/webmentions_ssg/templates/dashboard.html index a7f968e..70e2bf0 100644 --- a/webmentions_ssg/templates/dashboard.html +++ b/webmentions_ssg/templates/dashboard.html @@ -10,7 +10,6 @@ SPDX-License-Identifier: BSD-3-Clause <h1 class="mb-0">Dashboard</h1> <span class="text-body-secondary">Single-site overview</span> </div> - <div class="row g-4 mb-4"> <section class="col-lg-6" aria-labelledby="received-summary"> <div class="card h-100"> @@ -42,7 +41,6 @@ SPDX-License-Identifier: BSD-3-Clause </div> </div> </section> - <section class="col-lg-6" aria-labelledby="sent-summary"> <div class="card h-100"> <div class="card-body"> @@ -78,7 +76,6 @@ SPDX-License-Identifier: BSD-3-Clause </div> </section> </div> - <section class="mb-4" aria-labelledby="recent-activity"> <h2 class="h4" id="recent-activity">Recent activity</h2> <div class="table-responsive"> @@ -105,7 +102,6 @@ SPDX-License-Identifier: BSD-3-Clause </table> </div> </section> - <section aria-labelledby="operations"> <h2 class="h4" id="operations">Operations</h2> <div class="row g-3"> diff --git a/webmentions_ssg/templates/received.html b/webmentions_ssg/templates/received.html index b8099aa..2edf881 100644 --- a/webmentions_ssg/templates/received.html +++ b/webmentions_ssg/templates/received.html @@ -34,9 +34,10 @@ SPDX-License-Identifier: BSD-3-Clause } } %} -{% macro sortable_header(label, column) %} +{% macro sortable_header(label, column, responsive_class="") %} {% set active = sort_key == column %} <th scope="col" + class="{{ responsive_class }}" aria-sort="{{ ('ascending' if sort_order == 'asc' else 'descending') if active else 'none' }}"> <a href="{{ sort_urls[column] }}" class="link-body-emphasis text-decoration-none"> @@ -112,11 +113,11 @@ SPDX-License-Identifier: BSD-3-Clause aria-label="Received Webmention actions"> {% if webmentions.items %} <span id="received-selected-count" - class="text-body-secondary" + class="text-body-secondary d-none d-md-inline" role="status" aria-live="polite">0 selected</span> <button type="button" - class="btn btn-sm btn-outline-primary" + class="btn btn-sm btn-outline-primary d-none d-md-inline-block" disabled data-bs-toggle="modal" data-bs-target="#confirmation-modal" @@ -127,7 +128,7 @@ SPDX-License-Identifier: BSD-3-Clause data-confirm-label="Reverify selected" data-confirm-class="btn-primary">Reverify selected</button> <button type="button" - class="btn btn-sm btn-outline-warning" + class="btn btn-sm btn-outline-warning d-none d-md-inline-block" disabled data-bs-toggle="modal" data-bs-target="#confirmation-modal" @@ -138,7 +139,7 @@ SPDX-License-Identifier: BSD-3-Clause data-confirm-label="Block selected domains" data-confirm-class="btn-warning">Block selected source domains</button> <button type="button" - class="btn btn-sm btn-outline-danger" + class="btn btn-sm btn-outline-danger d-none d-md-inline-block" disabled data-bs-toggle="modal" data-bs-target="#confirmation-modal" @@ -164,7 +165,7 @@ SPDX-License-Identifier: BSD-3-Clause <table class="table table-bordered table-striped table-hover align-middle"> <thead> <tr> - <th scope="col"> + <th scope="col" class="d-none d-md-table-cell"> <input type="checkbox" class="form-check-input" id="received-select-all" @@ -172,9 +173,9 @@ SPDX-License-Identifier: BSD-3-Clause </th> {{ sortable_header('Status', 'status') }} {{ sortable_header('Source', 'source') }} - {{ sortable_header('Target', 'target') }} - {{ sortable_header('Received', 'received') }} - {{ sortable_header('Updated', 'updated') }} + {{ sortable_header('Target', 'target', 'd-none d-md-table-cell') }} + {{ sortable_header('Received', 'received', 'd-none d-md-table-cell') }} + {{ sortable_header('Updated', 'updated', 'd-none d-md-table-cell') }} <th scope="col">Details</th> </tr> </thead> @@ -182,26 +183,32 @@ SPDX-License-Identifier: BSD-3-Clause {% for webmention in webmentions %} {% set style = received_status_presentation.get(webmention.status, {"row_class": "table-danger", "badge_class": "text-bg-danger", "label": "Declined"}) %} <tr class="{{ style.row_class }}"> - <td> + <td class="d-none d-md-table-cell"> <input type="checkbox" class="form-check-input received-select" value="{{ webmention.uuid }}" aria-label="Select webmention {{ webmention.uuid }}"> </td> <td><span class="badge {{ style.badge_class }}">{{ style.label }}</span></td> - <td> + <td class="text-break"> <a href="{{ webmention.source }}">{{ webmention.source }}</a> + <div class="small mt-1 d-md-none"> + Received + <time datetime="{{ webmention.created_at.isoformat() }}"> + {{ webmention.created_at.strftime("%Y-%m-%d %H:%M:%S") }} + </time> + </div> </td> - <td> + <td class="d-none d-md-table-cell text-break"> <a href="{{ webmention.target }}">{{ webmention.target }}</a> </td> - <td class="text-nowrap"> + <td class="text-nowrap d-none d-md-table-cell"> <time datetime="{{ webmention.created_at.isoformat() }}" title="{{ webmention.created_at.strftime('%Y-%m-%d %H:%M:%S') }} UTC"> {{ webmention.created_at.strftime("%Y-%m-%d %H:%M:%S") }} </time> </td> - <td class="text-nowrap"> + <td class="text-nowrap d-none d-md-table-cell"> <time datetime="{{ webmention.updated_at.isoformat() }}" title="{{ webmention.updated_at.strftime('%Y-%m-%d %H:%M:%S') }} UTC"> {{ webmention.updated_at.strftime("%Y-%m-%d %H:%M:%S") }} diff --git a/webmentions_ssg/templates/sent.html b/webmentions_ssg/templates/sent.html index 2b0fbe4..d949f01 100644 --- a/webmentions_ssg/templates/sent.html +++ b/webmentions_ssg/templates/sent.html @@ -24,55 +24,57 @@ SPDX-License-Identifier: BSD-3-Clause </div> </div> {% if sources.items %} - <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('webmentions.source_detail', source_uuid=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> + <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" class="d-none d-md-table-cell">URL</th> + <th scope="col">Webmentions</th> + <th scope="col" class="d-none d-md-table-cell">Revision</th> + <th scope="col" class="d-none d-md-table-cell">Created</th> + <th scope="col" class="d-none d-md-table-cell">Last seen</th> + <th scope="col">Status</th> </tr> - {% endfor %} - </tbody> - </table> + </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-break"> + <a href="{{ url_for('webmentions.source_detail', source_uuid=source.uuid) }}">{{ source.path }}</a> + </td> + <td class="text-break d-none d-md-table-cell"> + <a href="{{ source.url }}">{{ source.url }}</a> + </td> + <td>{{ source.sent_webmentions | length }}</td> + <td class="d-none d-md-table-cell">{{ source.revision }}</td> + <td class="text-nowrap d-none d-md-table-cell"> + <time datetime="{{ source.created_at.isoformat() }}"> + {{ source.created_at.strftime("%Y-%m-%d %H:%M:%S") }} + </time> + </td> + <td class="text-nowrap d-none d-md-table-cell"> + <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> {% if sources.pages > 1 %} <div class="mt-3">{{ render_pagination(sources) }}</div> {% endif %} diff --git a/webmentions_ssg/templates/sent_source.html b/webmentions_ssg/templates/sent_source.html index 2b7a377..6e34458 100644 --- a/webmentions_ssg/templates/sent_source.html +++ b/webmentions_ssg/templates/sent_source.html @@ -88,119 +88,122 @@ SPDX-License-Identifier: BSD-3-Clause <span class="text-body-secondary">{{ webmentions.total }} webmentions</span> </div> {% if webmentions.items %} - <table class="table table-bordered table-striped table-hover align-middle"> - <thead> - <tr> - <th scope="col" class="w-25">Target</th> - <th scope="col">Status</th> - <th scope="col">Active</th> - <th scope="col">Revisions</th> - <th scope="col">Delivery</th> - <th scope="col">Last activity</th> - <th scope="col">Actions</th> - </tr> - </thead> - <tbody> - {% for webmention in webmentions %} - {% set style = sent_status_presentation.get(webmention.status, {"row_class": "table-info", "badge_class": "text-bg-info", "label": "Pending" }) %} - <tr class="{{ style.row_class }}"> - <td class="text-break"> - <a href="{{ webmention.target }}">{{ webmention.target }}</a> - </td> - <td> - <span class="badge {{ style.badge_class }}">{{ style.label }}</span> - {% if webmention.failure_reason is not none %} - <div class="small mt-2">{{ webmention.failure_reason }}</div> - {% endif %} - </td> - <td> - {% if webmention.linked %} - <span class="badge text-bg-success">Active</span> - {% else %} - <span class="badge text-bg-danger">Removed</span> - {% endif %} - </td> - <td class="small text-nowrap"> - <div> - <strong>Desired:</strong> - {{ webmention.desired_revision }} - </div> - <div> - <strong>Processed:</strong> - {{ webmention.processed_revision - if webmention.processed_revision is not none - else "—" }} - </div> - <div> - <strong>Sent:</strong> - {{ webmention.sent_revision - if webmention.sent_revision is not none - else "—" }} - </div> - </td> - <td class="small"> - {% if webmention.webmention_endpoint is not none %} - <div class="mb-1"> - <strong>Endpoint:</strong> - <a href="{{ webmention.webmention_endpoint }}" class="text-break">{{ webmention.webmention_endpoint }}</a> + <div class="table-responsive"> + <table class="table table-bordered table-striped table-hover align-middle"> + <thead> + <tr> + <th scope="col">Target</th> + <th scope="col">Status</th> + <th scope="col" class="d-none d-md-table-cell">Active</th> + <th scope="col" class="d-none d-md-table-cell">Revisions</th> + <th scope="col" class="d-none d-md-table-cell">Delivery</th> + <th scope="col" class="d-none d-md-table-cell">Last activity</th> + <th scope="col">Actions</th> + </tr> + </thead> + <tbody> + {% for webmention in webmentions %} + {% set style = sent_status_presentation.get(webmention.status, {"row_class": "table-info", "badge_class": "text-bg-info", "label": "Pending" }) %} + <tr class="{{ style.row_class }}"> + <td class="text-break"> + <a href="{{ webmention.target }}">{{ webmention.target }}</a> + </td> + <td class="text-break"> + <span class="badge {{ style.badge_class }}">{{ style.label }}</span> + {% if webmention.failure_reason is not none %} + <div class="small mt-2">{{ webmention.failure_reason }}</div> + {% endif %} + </td> + <td class="d-none d-md-table-cell"> + {% if webmention.linked %} + <span class="badge text-bg-success">Active</span> + {% else %} + <span class="badge text-bg-danger">Removed</span> + {% endif %} + </td> + <td class="small text-nowrap d-none d-md-table-cell"> + <div> + <strong>Desired:</strong> + {{ webmention.desired_revision }} + </div> + <div> + <strong>Processed:</strong> + {{ webmention.processed_revision + if webmention.processed_revision is not none + else "—" }} + </div> + <div> + <strong>Sent:</strong> + {{ webmention.sent_revision + if webmention.sent_revision is not none + else "—" }} </div> - {% endif %} - {% if webmention.endpoint_response_status is not none %} + </td> + <td class="small d-none d-md-table-cell"> + {% if webmention.webmention_endpoint is not none %} + <div class="mb-1"> + <strong>Endpoint:</strong> + <a href="{{ webmention.webmention_endpoint }}" + class="text-break">{{ webmention.webmention_endpoint }}</a> + </div> + {% endif %} + {% if webmention.endpoint_response_status is not none %} + <div class="mb-1"> + <strong>HTTP:</strong> + {{ webmention.endpoint_response_status }} + </div> + {% endif %} + {% if webmention.status_url is not none %} + <div> + <strong>Status:</strong> + {% if webmention.status_url | is_http_url %} + <a href="{{ webmention.status_url }}" class="text-break">{{ webmention.status_url }}</a> + {% else %} + <span class="text-break">{{ webmention.status_url }}</span> + {% endif %} + </div> + {% endif %} + </td> + <td class="small text-nowrap d-none d-md-table-cell"> <div class="mb-1"> - <strong>HTTP:</strong> - {{ webmention.endpoint_response_status }} + <strong>Attempted:</strong> + <br> + {% if webmention.last_attempted_at is not none %} + <time datetime="{{ webmention.last_attempted_at.isoformat() }}"> + {{ webmention.last_attempted_at.strftime("%Y-%m-%d %H:%M:%S") }} + </time> + {% else %} + — + {% endif %} </div> - {% endif %} - {% if webmention.status_url is not none %} <div> - <strong>Status:</strong> - {% if webmention.status_url | is_http_url %} - <a href="{{ webmention.status_url }}" class="text-break">{{ webmention.status_url }}</a> + <strong>Sent:</strong> + <br> + {% if webmention.last_sent_at is not none %} + <time datetime="{{ webmention.last_sent_at.isoformat() }}"> + {{ webmention.last_sent_at.strftime("%Y-%m-%d %H:%M:%S") }} + </time> {% else %} - <span class="text-break">{{ webmention.status_url }}</span> + — {% endif %} </div> - {% endif %} - </td> - <td class="small text-nowrap"> - <div class="mb-1"> - <strong>Attempted:</strong> - <br> - {% if webmention.last_attempted_at is not none %} - <time datetime="{{ webmention.last_attempted_at.isoformat() }}"> - {{ webmention.last_attempted_at.strftime("%Y-%m-%d %H:%M:%S") }} - </time> - {% else %} - — - {% endif %} - </div> - <div> - <strong>Sent:</strong> - <br> - {% if webmention.last_sent_at is not none %} - <time datetime="{{ webmention.last_sent_at.isoformat() }}"> - {{ webmention.last_sent_at.strftime("%Y-%m-%d %H:%M:%S") }} - </time> - {% else %} - — - {% endif %} - </div> - </td> - <td> - <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) }}" - 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> - </td> - </tr> - {% endfor %} - </tbody> - </table> + </td> + <td> + <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) }}" + 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> + </td> + </tr> + {% endfor %} + </tbody> + </table> + </div> {% if webmentions.pages > 1 %} <div class="mt-3">{{ render_pagination(webmentions) }}</div> {% endif %} |
