From 44ece87ed14c5d19bd6ceabfd023e45561b08ef3 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Wed, 18 Nov 2026 08:56:44 +0100 Subject: style(receiver): simplify moderation terminology Rename source-domain rule labels to the broader "Moderation" and "Domain" wording across forms, navigation, templates, messages, and tests. --- tests/views/test_moderation.py | 2 +- webmentions_ssg/forms/moderation.py | 4 ++-- webmentions_ssg/models/moderation.py | 2 +- webmentions_ssg/static/js/received-bulk-actions.js | 2 +- webmentions_ssg/templates/base.html | 2 +- webmentions_ssg/templates/moderation.html | 4 ++-- webmentions_ssg/views/moderation.py | 6 +++--- webmentions_ssg/views/received.py | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/views/test_moderation.py b/tests/views/test_moderation.py index 26b7cc4..78ff661 100644 --- a/tests/views/test_moderation.py +++ b/tests/views/test_moderation.py @@ -52,7 +52,7 @@ def test_add_and_unblock_source_domain(app: Flask, client: FlaskClient) -> None: assert response.status_code == HTTPStatus.OK assert b"spam.example" in response.data assert b"Unblock" in response.data - assert b"Source rules" in response.data + assert b"Moderation" in response.data response = client.post(f"/moderation/blocked/{entry_id}/delete") assert response.status_code == HTTPStatus.FOUND diff --git a/webmentions_ssg/forms/moderation.py b/webmentions_ssg/forms/moderation.py index 5987d14..136901b 100644 --- a/webmentions_ssg/forms/moderation.py +++ b/webmentions_ssg/forms/moderation.py @@ -12,9 +12,9 @@ from ..hostname import normalize_hostname class ModerateDomainForm(FlaskForm): - """Add a source domain to the blocklist or allowlist.""" + """Add a domain to the blocklist or allowlist.""" - domain = StringField("Source domain", validators=[InputRequired()]) + domain = StringField("Domain", validators=[InputRequired()]) submit = SubmitField("Add domain") def validate_domain(self, field: Field) -> None: diff --git a/webmentions_ssg/models/moderation.py b/webmentions_ssg/models/moderation.py index 4200c39..fb0328a 100644 --- a/webmentions_ssg/models/moderation.py +++ b/webmentions_ssg/models/moderation.py @@ -11,7 +11,7 @@ from ..extensions import Base class BlockedDomain(Base): - """Source domain rejected before submission or verification.""" + """Domain rejected before submission or verification.""" __tablename__ = "blocked_domains" diff --git a/webmentions_ssg/static/js/received-bulk-actions.js b/webmentions_ssg/static/js/received-bulk-actions.js index 06ab912..15aafa7 100644 --- a/webmentions_ssg/static/js/received-bulk-actions.js +++ b/webmentions_ssg/static/js/received-bulk-actions.js @@ -53,7 +53,7 @@ document.addEventListener("DOMContentLoaded", () => { if (action === "delete") { message.textContent = `This permanently deletes ${selection.length} selected webmentions and cannot be undone.`; } else if (action === "block-sources") { - message.textContent = `Source domains from ${selection.length} selected webmentions (and their subdomains) will be blocked. Existing webmentions will be kept.`; + message.textContent = `Domains from ${selection.length} selected webmentions (and their subdomains) will be blocked. Existing webmentions will be kept.`; } else { message.textContent = `${selection.length} selected webmentions will be fetched and verified again.`; } diff --git a/webmentions_ssg/templates/base.html b/webmentions_ssg/templates/base.html index 115f193..17c06d2 100644 --- a/webmentions_ssg/templates/base.html +++ b/webmentions_ssg/templates/base.html @@ -48,7 +48,7 @@ SPDX-License-Identifier: BSD-3-Clause Received Source rules + href="{{ url_for('webmentions.moderation') }}">Moderation Sent Source domain rules +

Moderation

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 @@ -25,7 +25,7 @@ SPDX-License-Identifier: BSD-3-Clause class="row g-2 align-items-end mb-3">

- + ResponseReturnValue: """Manage blocklist and allowlist entries used by the receiver.""" return render_template( "moderation.html", - title="Source domain rules", + title="Moderation", blocked=db.session.scalars( sa.select(BlockedDomain).order_by(BlockedDomain.domain) ).all(), @@ -83,7 +83,7 @@ def moderation_domain_add(kind: str) -> ResponseReturnValue: except IntegrityError: db.session.rollback() - flash(f"Source domain {domain} added to {kind} list.", "success") + flash(f"Domain {domain} added to {kind} list.", "success") return redirect(url_for("webmentions.moderation")) @@ -101,5 +101,5 @@ def moderation_domain_delete(kind: str, entry_id: int) -> ResponseReturnValue: domain = entry.domain db.session.delete(entry) db.session.commit() - flash(f"Source domain {domain} removed from {kind} list.", "success") + flash(f"Domain {domain} removed from {kind} list.", "success") return redirect(url_for("webmentions.moderation")) diff --git a/webmentions_ssg/views/received.py b/webmentions_ssg/views/received.py index ef63893..e49ee31 100644 --- a/webmentions_ssg/views/received.py +++ b/webmentions_ssg/views/received.py @@ -444,5 +444,5 @@ def block_received_source(webmention_uuid: uuid.UUID) -> ResponseReturnValue: block_domains({domain}) - flash(f"Source domain {domain} blocked.", "success") + flash(f"Domain {domain} blocked.", "success") return received_action_redirect(webmention_uuid, filters) -- cgit v1.3.1