blob: 4ca75cea8c83a4c5c4d1c282e2700e974c772987 (
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
<!--
SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
SPDX-License-Identifier: BSD-3-Clause
-->
{% 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>
<div class="d-flex flex-column justify-content-between">
<span class="text-body-secondary mb-1">{{ sources.total }} sources</span>
<button type="button"
class="btn btn-sm btn-primary"
data-bs-toggle="modal"
data-bs-target="#confirmation-modal"
data-action="{{ url_for("root.rescan_sent_sources") }}"
data-title="Rescan sources?"
data-message="All sources will be scanned again for changes and webmentions."
data-confirm-label="Rescan"
data-confirm-class="btn-primary">Rescan</button>
</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>
</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>
{% if sources.pages > 1 %}
<div class="mt-3">{{ render_pagination(sources) }}</div>
{% endif %}
{% include "includes/confirmation_modal.html" %}
{% else %}
<p class="text-body-secondary">No Webmention sources have been discovered yet.</p>
{% endif %}
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{ url_for('static', filename='js/confirmation-modal.js') }}"></script>
{% endblock %}
|