aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates/received.html
blob: ea745579ed492af2d5a39c03afb1a09e6d335844 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{% extends "base.html" %}
{% from "bootstrap5/pagination.html" import render_pagination %}
{% block content %}
  <div class="d-flex justify-content-between align-items-center mb-3">
    <h1 class="h3 mb-0">Received Webmentions</h1>
    <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>
          </tr>
        </thead>
        <tbody>
          {% for webmention in webmentions %}
            {% if webmention.status == "verified" %}
              {% set row_class = "table-success" %}
              {% set display_status = "Verified" %}
            {% elif webmention.status in ("received", "verifying") %}
              {% set row_class = "table-warning" %}
              {% set display_status = "Pending" %}
            {% 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>
            </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
    {% if webmentions.pages > 1 %}
      <div class="mt-3">
        {{ render_pagination(webmentions,
                align="center",
                size="sm") }}
      </div>
    {% endif %}
  {% else %}
    <p class="text-body-secondary">No Webmentions have been received yet.</p>
  {% endif %}
{% endblock %}