aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates/moderation.html
diff options
context:
space:
mode:
authorDennis Fink2026-11-17 17:09:59 +0100
committerDennis Fink2026-11-17 17:09:59 +0100
commit6d6d079a3a99d3d3a922a640b6925eb2adf044de (patch)
tree33cc19241f4ce86ea43b2f194087c58e3fdc8a4d /webmentions_ssg/templates/moderation.html
parent227092b57acc886469e16bcc4c0d3256e86d3d1e (diff)
downloadwebmentions-ssg-6d6d079a3a99d3d3a922a640b6925eb2adf044de.tar.gz
webmentions-ssg-6d6d079a3a99d3d3a922a640b6925eb2adf044de.zip
refactor(core)!: split forms and models by feature
Replace monolithic form and model modules with focused packages for receiver, moderation, source, user, and shared validation concerns. Rename source policy concepts to domain moderation, including routes, models, tables, configuration, templates, and tests. BREAKING CHANGE: form and model import paths, moderation routes, and `SOURCE_ALLOWLIST_ENABLED` have changed; use `ALLOWLIST_ENABLED` and the new feature-specific modules.
Diffstat (limited to 'webmentions_ssg/templates/moderation.html')
-rw-r--r--webmentions_ssg/templates/moderation.html69
1 files changed, 69 insertions, 0 deletions
diff --git a/webmentions_ssg/templates/moderation.html b/webmentions_ssg/templates/moderation.html
new file mode 100644
index 0000000..e45fe3f
--- /dev/null
+++ b/webmentions_ssg/templates/moderation.html
@@ -0,0 +1,69 @@
+<!--
+SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
+
+SPDX-License-Identifier: BSD-3-Clause
+-->
+{% extends "base.html" %}
+
+{% block content %}
+ <h1 class="mb-3">Source domain rules</h1>
+ <p>
+ Entries match the named hostname and all of its subdomains (not similarly named domains).
+ Blocked domains always take precedence over allowed domains. Changes affect new
+ submissions and future verification attempts; existing mentions are not deleted.
+ </p>
+ <p>
+ Allowlist mode is <strong>{{ "enabled" if allowlist_enabled else "disabled" }}</strong>.
+ Set <code>ALLOWLIST_ENABLED = True</code> in the server configuration to
+ accept only listed source domains. An empty enabled allowlist rejects all sources.
+ </p>
+ {% for kind, entries in (("blocked", blocked), ("allowed", allowed)) %}
+ <section class="mb-4" aria-labelledby="{{ kind }}-heading">
+ <h2 id="{{ kind }}-heading">{{ "Blocked" if kind == "blocked" else "Allowed" }} domains</h2>
+ <form action="{{ url_for('webmentions.moderation_domain_add', kind=kind) }}"
+ method="post"
+ class="row g-2 align-items-end mb-3">
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
+ <div class="col-sm-8 col-md-5">
+ <label class="form-label" for="{{ kind }}-domain">Source domain</label>
+ <input class="form-control"
+ type="text"
+ id="{{ kind }}-domain"
+ name="domain"
+ placeholder="example.org"
+ required>
+ </div>
+ <div class="col-auto">
+ <button type="submit" class="btn btn-primary">Add domain</button>
+ </div>
+ </form>
+ {% if entries %}
+ <table class="table table-striped align-middle">
+ <thead>
+ <tr>
+ <th scope="col">Domain</th>
+ <th scope="col">Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for entry in entries %}
+ <tr>
+ <td class="text-break">{{ entry.domain }}</td>
+ <td>
+ <form action="{{ url_for('webmentions.moderation_domain_delete', kind=kind, entry_id=entry.id) }}"
+ method="post">
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
+ <button type="submit"
+ class="btn btn-sm btn-outline-danger">{{ "Unblock" if kind == "blocked" else "Remove" }}</button>
+ </form>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% else %}
+ <p class="text-body-secondary">No {{ kind }} domains.</p>
+ {% endif %}
+ </section>
+ {% endfor %}
+{% endblock %}