Skip to content

Commit 75ae627

Browse files
Generated portal pages get per-section headers; module list scrolls
Each generated section (Draw a map / Make a submission / Map gallery or Submissions) now opens with its own section_header block so the default page reads as distinct sections — editors rename or delete them like any other block. The wizard's module checkbox list is capped at 50vh with scroll overflow so long module catalogs stay navigable alongside the type-to-filter box. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 9c17860 commit 75ae627

2 files changed

Lines changed: 29 additions & 8 deletions

File tree

cms/content/portal_wizard.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,34 @@ def _starter_body(mode: str, *, title: str, slug: str, views: list[dict]):
8585
{"type": "section_header", "value": {"title": title}},
8686
{"type": "rich_text", "value": INTRO_PLACEHOLDER},
8787
]
88+
89+
# Each section opens with its own header so the generated page reads as
90+
# distinct sections; editors rename or delete them like any other block.
91+
def _section(header_title):
92+
return {"type": "section_header", "value": {"title": header_title}}
93+
8894
if views:
89-
body.append(
90-
{"type": "map_create_buttons", "value": {"views": views, "type": "cards"}}
91-
)
95+
body += [
96+
_section("Draw a map"),
97+
{"type": "map_create_buttons", "value": {"views": views, "type": "cards"}},
98+
]
9299
if mode in ("prompt", "form"):
93-
body.append(
94-
{"type": "form", "value": {"mandatoryTags": [], "allowListModules": []}}
95-
)
100+
body += [
101+
_section("Make a submission"),
102+
{"type": "form", "value": {"mandatoryTags": [], "allowListModules": []}},
103+
]
96104
# tags=[slug]: with no curated ids these galleries list entries tagged
97105
# with the portal's own tag — submissions appear automatically.
98106
if mode in ("prompt", "auto_public"):
99-
body.append({"type": "plan_gallery", "value": {"ids": [], "tags": [slug]}})
107+
body += [
108+
_section("Map gallery"),
109+
{"type": "plan_gallery", "value": {"ids": [], "tags": [slug]}},
110+
]
100111
elif mode == "form":
101-
body.append({"type": "comment_gallery", "value": {"ids": [], "tags": [slug]}})
112+
body += [
113+
_section("Submissions"),
114+
{"type": "comment_gallery", "value": {"ids": [], "tags": [slug]}},
115+
]
102116
return body
103117

104118

cms/content/templates/content/portal_wizard.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
{% block titletag %}New portal{% endblock %}
33

44
{% block content %}
5+
<style>
6+
/* The module list can be long; keep it scannable and scrollable. */
7+
#id_map_modules {
8+
max-height: 50vh;
9+
overflow-y: auto;
10+
}
11+
</style>
512
{% include "wagtailadmin/shared/header.html" with title="New portal" subtitle="Answer a few questions — the page is generated for you" icon="tag" %}
613

714
<div class="nice-padding">

0 commit comments

Comments
 (0)