aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates/sent.html
blob: 4993befc00634aa11dc39f1a41dbad7836e227a3 (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
{% 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="mb-0">Sources</h1>
    <span class="text-body-secondary">{{ sources.total }} sources</span>
  </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>
          </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', 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>
    {% if sources.pages > 1 %}
      <div class="mt-3">{{ render_pagination(sources) }}</div>
    {% endif %}
  {% else %}
    <p class="text-body-secondary">No Webmention sources have been discovered yet.</p>
  {% endif %}
{% endblock %}