aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates
diff options
context:
space:
mode:
Diffstat (limited to 'webmentions_ssg/templates')
-rw-r--r--webmentions_ssg/templates/sent.html29
1 files changed, 11 insertions, 18 deletions
diff --git a/webmentions_ssg/templates/sent.html b/webmentions_ssg/templates/sent.html
index b613f4b..46296b8 100644
--- a/webmentions_ssg/templates/sent.html
+++ b/webmentions_ssg/templates/sent.html
@@ -84,17 +84,7 @@ SPDX-License-Identifier: BSD-3-Clause
</thead>
<tbody>
{% for source in sources %}
- {% set statistics = namespace(sent=0, failed=0, retrying=0) %}
- {% for webmention in source.sent_webmentions %}
- {% if webmention.status == "sent" %}
- {% set statistics.sent = statistics.sent + 1 %}
- {% elif webmention.status == "failed" %}
- {% set statistics.failed = statistics.failed + 1 %}
- {% endif %}
- {% if webmention.awaiting_processing and webmention.attempt_count > 0 and webmention.next_retry_at is not none %}
- {% set statistics.retrying = statistics.retrying + 1 %}
- {% endif %}
- {% endfor %}
+ {% set counts = statistics[source.uuid] %}
{% if source.deleted_at is none %}
{% set row_class = "table-success" %}
{% set badge_class = "text-bg-success" %}
@@ -115,15 +105,18 @@ SPDX-License-Identifier: BSD-3-Clause
<a href="{{ source.url }}">{{ source.url }}</a>
</td>
<td>
- <span class="badge text-bg-info">{{ source.sent_webmentions | length }} Total</span>
- {% if statistics.sent %}
- <span class="badge text-bg-success">{{ statistics.sent }} sent</span>
+ <span class="badge text-bg-info">{{ counts.total }} Total</span>
+ {% if counts.sent %}
+ <span class="badge text-bg-success">{{ counts.sent }} sent</span>
{% endif %}
- {% if statistics.failed %}
- <span class="badge text-bg-danger">{{ statistics.failed }} failed</span>
+ {% if counts.no_endpoint %}
+ <span class="badge text-bg-secondary">{{ counts.no_endpoint }} no endpoint</span>
{% endif %}
- {% if statistics.retrying %}
- <span class="badge text-bg-warning">{{ statistics.retrying }} awaiting retry</span>
+ {% if counts.failed %}
+ <span class="badge text-bg-danger">{{ counts.failed }} failed</span>
+ {% endif %}
+ {% if counts.retrying %}
+ <span class="badge text-bg-warning">{{ counts.retrying }} awaiting retry</span>
{% endif %}
</td>
<td class="d-none d-md-table-cell">{{ source.revision }}</td>