diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-12 02:15:44 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-12 02:15:44 +0200 |
| commit | 45bf65d04d046c0ea4a1150096b2a9b846d6c0b8 (patch) | |
| tree | 24dad426779cb3b0ac59c405245aac1d28109982 /lib | |
| parent | 13c8cb415813e90c883a44b0c0888382161de92a (diff) | |
Give the sitemap its own view, with collapse and descendant counts
Extracted from admin#index's inline table into NodesController#sitemap.
Nested <details>/<summary> per branch, one linear pass over the
existing flat [node, level] list (no added queries) -- each node's own
descendant count computed the same way, via a small stack rather than
re-walking the tree per node. Branches under updates/, club/erfas,
club/chaostreffs, and disclosure start collapsed by default
(CccConventions::SITEMAP_COLLAPSED_PATHS); any branch currently
collapsed, whether by that default or because someone just closed it,
is highlighted via a plain :not([open]) selector -- no state tracked
outside the DOM itself.
Dropped the update?-post exclusion this view used to rely on -- no
longer needed now that updates/ collapses instead of being filtered
out, so its real children (previously silently absent) now show up
correctly. admin#index's own, separate @sitemap query is unchanged;
that view has no collapse mechanism to compensate and wasn't part of
this.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ccc_conventions.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ccc_conventions.rb b/lib/ccc_conventions.rb index b420452..352dd3c 100644 --- a/lib/ccc_conventions.rb +++ b/lib/ccc_conventions.rb | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | module CccConventions | 1 | module CccConventions |
| 2 | ERFA_PARENT_NAME = "club/erfas" | 2 | ERFA_PARENT_NAME = "club/erfas" |
| 3 | CHAOSTREFF_PARENT_NAME = "club/chaostreffs" | 3 | CHAOSTREFF_PARENT_NAME = "club/chaostreffs" |
| 4 | SITEMAP_COLLAPSED_PATHS = %w[updates club/erfas club/chaostreffs disclosure].freeze | ||
| 4 | 5 | ||
| 5 | NODE_KINDS = { | 6 | NODE_KINDS = { |
| 6 | "top_level" => { | 7 | "top_level" => { |
