diff options
| author | Dennis Fink | 2026-11-19 18:15:34 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-19 18:15:34 +0100 |
| commit | 8ec35babe87ff8139ec23cc10b858b7481f132db (patch) | |
| tree | b1e2b2507abba25b570a32e7274b6c0158eac653 /webmentions_ssg/forms | |
| parent | 45d3d3fde75173dfbf27e08aae8501842a9511dd (diff) | |
| download | webmentions-ssg-8ec35babe87ff8139ec23cc10b858b7481f132db.tar.gz webmentions-ssg-8ec35babe87ff8139ec23cc10b858b7481f132db.zip | |
refactor(sender)!: align sent Webmention terminology
Rename source-list forms, views, helpers, and tests around the Sent
Webmentions UI while keeping source documents as the grouping model.
BREAKING CHANGE: authenticated outgoing routes move from `/sources` to
`/sent`, with corresponding blueprint endpoint and Python module
renames.
Diffstat (limited to 'webmentions_ssg/forms')
| -rw-r--r-- | webmentions_ssg/forms/sent.py (renamed from webmentions_ssg/forms/sources.py) | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/webmentions_ssg/forms/sources.py b/webmentions_ssg/forms/sent.py index 04afe77..65a2708 100644 --- a/webmentions_ssg/forms/sources.py +++ b/webmentions_ssg/forms/sent.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-3-Clause -"""Source document filtering form.""" +"""Filters for the sent Webmentions page.""" from flask import current_app from flask_wtf import FlaskForm @@ -18,23 +18,23 @@ from wtforms.validators import AnyOf, NumberRange, Optional from .validators import CanonicalDate -SOURCE_STATUS_CHOICES = { - "": "All sources", +SENT_STATUS_CHOICES = { + "": "All source documents", "failing": "Failing sends", "retrying": "Awaiting retry", - "deleted": "Deleted sources", + "deleted": "Deleted source documents", } -def default_source_page_size() -> int: +def default_sent_page_size() -> int: """Use 25 rows unless the configured maximum is lower.""" return min(25, current_app.config["SOURCES_MAX_PAGE_SIZE"]) -class SourceFilterForm(FlaskForm): - """GET filters for the source document list.""" +class SentFilterForm(FlaskForm): + """GET filters for sent Webmentions grouped by source document.""" - status = SelectField("Status", choices=SOURCE_STATUS_CHOICES, default="") + status = SelectField("Status", choices=SENT_STATUS_CHOICES, default="") q = SearchField("Path or URL") date_from = DateField( "Last seen from (UTC)", validators=[Optional(), CanonicalDate()] @@ -59,12 +59,12 @@ class SourceFilterForm(FlaskForm): order = HiddenField(default="desc", validators=[AnyOf(("asc", "desc"))]) per_page = IntegerField( "Rows per page", - default=default_source_page_size, + default=default_sent_page_size, validators=[NumberRange(min=1)], ) def validate_per_page(self, field: IntegerField) -> None: - """Enforce the deployment's maximum source-list page size.""" + """Enforce the deployment's maximum source-document page size.""" if ( field.data is not None and field.data > current_app.config["SOURCES_MAX_PAGE_SIZE"] |
