summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
17 hoursAdd NodeAction: an append-only log of who did what to a nodeHEADmastererdgeist
node_id/page_id/user_id are lookup and ordering only -- all three nullify on delete, so an entry outlives its actor and its subject. Everything that must survive those deletions lives in a mandatory metadata jsonb written once at creation: the actor's username, the node's human-readable name (pinned to the default locale), and action-specific extras such as publish's title from/to. NodeAction.record! is the single constructor, so every entry gets the same baseline metadata without each call site re-implementing it. occurred_at is one field for live and backfilled entries alike; inferred_from distinguishes them -- nil means witnessed at the moment it happened, populated names how a backfilled entry was estimated. Instrumented so far: publish (crediting the actual publisher, threaded through from the controller -- previously nobody had the act of publishing recorded anywhere), revert's discard_autosave and destroy_draft branches, and translation destroy. publish_draft! now runs in a transaction so the promotion and its log entry land together. The remaining verbs follow once this mechanism has proven itself.
20 hoursMake the recent-changes page match the widget it links fromerdgeist
nodes/recent rendered the generic node-listing partial (id, actions, current lock owner, revision number) -- nothing resembling what 'See all recent changes' actually promised to show more of. Both surfaces now render the same extracted partial, so they can't tell two different stories again. Also: head.editor correctly identifies who last wrote the content sitting in head, but publish_draft! never touches editor at all -- nobody has ever had the specific act of publishing recorded anywhere. 'Published by X' was a claim the data never supported, only incidentally true when the same person who drafted something also happened to publish it. Relabeled to 'last edited by' -- same data, accurately described. A real publish-actor is separate, future work, once the action log exists. Basic list styling added for the full page, which had never rendered outside the widget's own compact five-line context before.
20 hoursRemove dead admin/_recent_changes partialerdgeist
26 hoursAdd scaffolding for a proper tech documentation from everything I could remembererdgeist
27 hoursSupply related-asset URLs/name and public inline-image CSSerdgeist
RelatedAssetsController#create's JSON includes large_url, original_url, and name alongside thumb_url/url; the related-asset list items in both editors carry them as data-large-url, data-original-url, and data-name. ccc.css gets the public-facing .inline-image--full/--half/--left/ --right rules -- admin.css and TinyMCE's content_style cover the cockpit and in-editor renderings respectively.
27 hoursAdd inline image insertion for page bodies, plus a headline-conflict badgeerdgeist
Custom TinyMCE toolbar button opens a picker scoped to a page's own attached images. Selecting one and a placement (full width, left, right) inserts <a class="glightbox" data-gallery="page-N"> wrapping an <img>, sharing the existing headline-image lightbox gallery. No native TinyMCE image dialog or resize handles -- placement is fixed to the three options via CSS classes only. extended_valid_elements defines a and img explicitly and symmetrically; valid_classes allows the placement classes and glightbox specifically. content_style renders placement inside the editing iframe, since ccc.css doesn't load there. A pre-save pass removes any a.glightbox left without an img, covering in-editor deletion regardless of how it happened. Alt text comes from the asset's name, escaped. A badge marks whichever attached image sits at position 0, since _headline_image.html.erb always renders that position as the page's automatic headline. Shown in the sidebar Images list and in the picker grid.
29 hoursExtend static-asset cache-busting to the public layouterdgeist
mtime_busted_path only ever covered the four admin-only static files. The public layout has the identical exposure -- ccc.css, glightbox's vendored CSS/JS, and public.js are all served straight from public/ with no pipeline fingerprinting either -- just never got the same treatment.
30 hoursCrop headline images to aspect ratio instead of distorting themerdgeist
STYLES restructured from a single geometry: string per style to a full args: array, since this fix needs -gravity and -extent alongside -resize, which one geometry string can't express.
30 hoursAdd a :large FileAttachment style for full-width inline body imageserdgeist
Sized generously (1600x1600>) rather than against today's cramped 490px content column specifically -- shrinking an oversized source to fit a narrow container is free and looks fine; a source too small for a future, wider redesign has no fix short of re-uploading every image. Purely additive: nothing reads :large yet, and generate_variants already loops over the whole STYLES hash generically, so no other code needed to change for new uploads to start getting it. Test suite's own hardcoded style lists updated in the same commit so they don't quietly drift out of sync with what the app actually defines.
31 hoursRetire wipe_draft! and find_or_create_draft from production codeerdgeist
Both had already lost their reason to exist as production API: wipe_draft!'s one remaining callsite (nodes#show) was removed two sessions ago, and find_or_create_draft had zero production callers left at all -- confirmed by a fresh grep, not assumed -- every one of its ~65 call sites was test setup, unrelated to what those tests actually cover. wipe_draft! is deleted outright, along with its two tests -- the lock/draft/autosave cleanup it silently performed already has explicit, always-visible manual equivalents (Unlock, Discard Autosave, Destroy Draft), so nothing real is lost. find_or_create_draft moves to test_helper.rb as a plain method on ActiveSupport::TestCase, alongside the create_node_with_draft/ create_node_with_published_page helpers already living there -- extending the framework's own designated test-extension point rather than reopening the Node model from test code. Its three tests of real dispatch behavior (idempotency on repeat calls, and raising when a second user contends for the lock) are kept, since ~65 other tests depend on this helper actually working correctly; only the call syntax changed, from node.find_or_create_draft(user) to find_or_create_draft(node, user).
41 hoursAdd chapter images: thumbnail on the list, headline image on the detail pageerdgeist
_chapter.html.erb (the aggregator partial used by the erfas/ chaostreffs overview pages) never rendered an image at all -- editors attaching a hackerspace photo via the asset picker would see zero visible effect on exactly the pages they'd check first. chapter_detail.html.erb (the individual page template) had the same gap. Both fixed by reusing existing infrastructure rather than inventing anything: the overview list gets a small, aspect-preserving :thumb image beside the heading; the detail page gets the app's existing headline_image helper, the same one every other full-page template already uses.
41 hoursAdd a toggleable live preview panel to both editorserdgeist
Hidden by default, shares horizontal space with the body editor once opened rather than a separate section, and only requests the iframe's src on first toggle -- no preview traffic at all until someone actually wants to see it. Refreshes automatically on every successful autosave; a separate force-render button re-attempts a save-and- refresh cycle immediately, for when the normal 7-second cycle has been interrupted (a lock-lost error, a transient failure) and waiting for the next tick isn't good enough.
43 hoursMake revisions locale awareerdgeist
44 hoursAdd tooltips to all navbar itemserdgeist
44 hoursMake tags a pill list on nodes#showerdgeist
44 hoursStore return_to before resetting session in loging. Fixes returning to an admin page before logging inerdgeist
45 hoursRe-add language selector, but fix the mis-nomer for english pageserdgeist
46 hoursMerge branch 'erdgeist-revive-events'erdgeist
46 hoursRemove orphaned language selector for admin viewserdgeist
46 hoursAdd cache-buster using mtime of css and js files outside the asset pipelineerdgeist
2 daysRemove redundant default translation from the translations subsectionerdgeist
2 daysFix: p elements can't contain buttons. Convert it to a diverdgeist
2 daysMake revision diffs locale-aware, defaulting to whichever locale changederdgeist
diff_against compared title/abstract/body under whatever I18n.locale happened to be ambient, with no concept of 'diff this translation specifically' -- so a change confined to one locale was invisible to Diff Head vs. Draft regardless of which locale you were looking at when you clicked it, exactly the 'yields nothing' complaint from earlier this session. Page#diff_against gains a locale: keyword, additive only -- nil preserves the exact original ambient-locale behavior every existing caller and test already depends on; passing a locale switches to reading each side's actual PageTranslation row directly, same fallback-free reasoning as Page#translation_summary. Page#locale_diff_summary reports one entry per locale present on either side, so an added or removed translation counts as a change even where content matches everywhere it exists on both. RevisionsController#diff now resolves a real locale before diffing -- defaulting to whichever locale actually changed, falling back to the default locale only when nothing did -- and the view carries that locale through every existing control (view toggle, layer-pair buttons, the revision-select form) so it and the view/layer-pair axis stay independently selectable rather than resetting each other.
2 daysclone_attributes_from: update translations in place, not delete+recreateerdgeist
Every promotion (autosave creation, draft creation, draft save) ran every locale's translation through delete-all-then-recreate unconditionally, giving every locale a fresh created_at/updated_at regardless of whether its content actually changed. Confirmed via Node.find(546).draft.translations -- both DE and EN shared one identical timestamp despite only EN having been edited. This silently defeated Page.find_with_outdated_translations' whole staleness comparison: every save reset every locale back into lockstep, so timestamps could never actually drift apart the way the feature depends on. The existing test for it only ever passed by manually backdating a timestamp with record_timestamps = false, bypassing normal save flow entirely -- not something that happens through ordinary editing. Now updates a matching locale's translation only when its own attributes actually differ, creates one genuinely new, and removes one genuinely gone from the source -- same end state, but real per-locale timestamps survive an unrelated save. search_vector is excluded from both the comparison and the copied attributes: it's DB-trigger-maintained from title/abstract, not real content, and comparing a precomputed tsvector risked a false 'changed' from representation noise alone. Also reloads the source's translations association, not just self's -- clone_attributes_from previously only guaranteed a fresh self, leaving any caller holding a page reference across an earlier mutation vulnerable to reading a stale cached association.
2 daysFix autosave bug: sync tinymce's state back to textarea before serializingerdgeist
2 daysFix shared preview redirecting to admin for an ordinary new drafterdgeist
superseded/currently_public used published_at presence as a proxy for page-row relevance, but published_at is carried forward onto every new draft descended from previously-published content (Page#clone_attributes_from, Node#save_draft!) -- so it read true for any draft on an already-published node, whether or not that specific draft had ever gone live itself. Compare draft_id/head_id identity directly instead; no timestamp involved. A stale (superseded) link now redirects to the live public page rather than an admin URL an anonymous holder can't reach anyway.
2 daysWire real autosave into translation editingerdgeist
The shared TinyMCE setup initializes cccms.setup_autosave() on any page with a textarea.with_editor, unconditionally starting a 7-second interval that submits to the form's data-autosave-url -- which the translation edit form never set, so the interval PUT the current page URL itself and 404'd on a nonexistent route. Fixed by actually giving it something to talk to, rather than suppressing it: a real autosave endpoint, and update now goes through Node#autosave!/#save_draft! -- the same pipeline the primary editor uses, fixed earlier this session for exactly this kind of cross-locale carryover. This was the autosave-buffer parity already flagged as due after the proof of concept; the shared JS just forced the timing.
2 daysAdd per-node translation management: list, edit, destroy, compareerdgeist
Replaces the old locale-switch-and-edit-the-same-screen workflow, which conflated presentation locale with content locale and let an editor silently drift into editing the wrong language with no persistent signal that anything had changed. Non-default-locale content now has its own explicit routes and screens, never sharing a route param with the ambient chrome locale. - PageTranslationsController: index/show/edit/update/destroy, scoped to Page.non_default_locales; update handles first-time creation too, so there's no separate new/create step. - Reads go through the actual PageTranslation row (Page#translation_summary), never through the Globalize fallback-bearing accessor -- fallback is correct for public rendering but wrong for editing, where a missing translation needs to look empty, not borrowed from another locale. - Translations ride on the page's own draft/head cycle; no independent publish state. - nodes#show gains a Translations section (per-locale Lock+Edit / Create+Lock, Destroy, a link into the read-only Compare view) and a locale indicator on its own default-locale content; nodes#edit, nodes#update, and nodes#autosave are pinned to the default locale via Globalize.with_locale regardless of the ambient route locale. - nodes#show no longer double-loads the node or calls wipe_draft! on every view (see previous commit for why that's now safe). - .preview_link_row is renamed .aligned_action_row now that it has a second real consumer.
2 dayswipe_draft!: add a grace period to the lock-with-no-draft brancherdgeist
Its other two branches both require a day's inactivity before touching anything; this one didn't, so a lock acquired seconds ago with nothing drafted yet looked identical to one abandoned for a week -- confirmed with a throwaway script showing a lock cleared inside a single method call. Guarded on autosave.nil? specifically, since the method's first line already guarantees any autosave reaching this branch is a day old by construction.
2 daysnodes#show: show each revision's editor, not its byline authorerdgeist
page.user is the piece's credited author, carried forward across revisions; page.editor is whoever actually produced this specific revision. The revisions list wants the latter -- found by inspection while testing something unrelated.
2 daysSet config.i18n.available_locales explicitlyerdgeist
Rails-i18n's bundled locale data means an unset available_locales defaults to every locale it ships pluralization/date rules for -- several hundred, not the two this app actually supports. Harmless everywhere the outer route scope's own /de|en/ regex already narrowed whatever reached I18n.available_locales.include?(...), but the first code to read the list directly (Page.non_default_locales) took it at face value. Also closes a related, independently-silent gap in Page#rewrite_links_in_body, which used the same unconstrained list to decide whether a link was already locale-prefixed.
2 daysCarry over other-locale translations when creating an autosaveerdgeist
Node#autosave! only copied assets forward onto a newly created autosave, not translations. Invisible for single-locale nodes, but a node with an existing multi-locale head/draft that gets locked and edited in one locale would silently drop every other locale's translation from the new autosave -- and from there into the draft and eventually head, since save_draft! faithfully clones whatever the autosave actually holds. Fixed by using clone_attributes_from, which already does a complete clone (translations, assets, tags, template, published_at) -- the same method save_draft! already relies on two branches later, so no new mechanism, just closing the one place still doing a partial, hand-rolled version of it.
3 daysAsset picker: attach/detach/reorder UI, read-only view, autosave fixerdgeist
Replaces nodes#edit's old Images section -- a hidden panel dumping every image asset in the system unfiltered (#image_browser) plus a raw drag-and-drop box (#image_box) -- with a small search-and-click picker built on the endpoint from the last two commits. Attaching posts immediately and appends the new thumbnail via a cloned <template> -- icons only render correctly through the Rails helper server-side, so the template holds real, pre-rendered markup for JS to clone rather than duplicating raw SVG in a JS string. Reordering is jQuery UI sortable on the small attached list only, with a dedicated drag handle rather than the whole thumbnail. Two bugs caught while click-testing, fixed here rather than shipped and patched after: the search panel never closed after attaching an image, since the success handler re-triggered focus to keep it open for attaching several in a row -- which meant it just re-populated itself forever instead of signaling "done." Fixed to close explicitly; a click-outside-closes handler was added alongside it, matching the affordance the top-bar search already has. A real, independent, pre-existing data bug surfaced during the same testing: Node#autosave!'s first-time-creation branch never carried related assets forward from whatever page was previously current -- attach an image, let autosave fire once, and it silently landed on a fresh, assetless Page row. Long-dormant, not introduced by this work, just finally exercised by something that made it visible. Fixed inside the `unless self.autosave` guard specifically -- running this on every call, not just creation, would overwrite anything attached directly to an existing autosave in between, a worse bug than the one being fixed. nodes#show gains a read-only Images section, rendered only when a page actually has attached images, so an attachment can be confirmed present without entering the edit/lock cycle -- useful on its own, and specifically useful the next time an asset bug needs investigating. Its thumbnail CSS is shared with the edit view's picker via a class (.thumbnail_list) rather than duplicated under a second name.
3 daysAdd assets:regenerate_variants rake taskerdgeist
Regenerates ImageMagick variants from each asset's stored original -- needed because assets uploaded before :headline existed in FileAttachment::STYLES never had that file generated, producing a 404 rather than a distorted image. Supports ASSET_ID=N scoping so a single asset can be tested before committing to a full, expensive sweep across everything. Doesn't touch the separate, still-open problem of :headline's forced non-uniform stretch (460x250!) -- this task faithfully regenerates whatever geometry the style defines, correctly. Fixing the distortion itself is its own, later piece.
3 daysAdd loadOnFocus to initSearchPicker; asset search shows recent by defaulterdgeist
initSearchPicker's input handler has always short-circuited on an empty term -- correct for every existing picker, none of which want results appearing before anything's typed. The asset picker does want exactly that (show the last few uploaded images without requiring a search first), so this adds an opt-in loadOnFocus option instead of changing the shared default: it fires once when the input gains focus with no term yet, reusing the same request/render path a real search uses rather than a separate code path. The AJAX call itself was pulled out into a named runSearch function so both triggers could share it without duplicating the success/render logic. RelatedAssetsController#search now treats a blank term as "show the most recently created, unattached images" (limit 5) rather than returning nothing, matching the new client behavior. A real search term still returns up to 10 name-matched results, unchanged.
3 daysAdd RelatedAssetsController: search, attach, detach, reordererdgeist
Backend for the asset-picker rebuild -- replaces the plan to dump every image asset in the system into a hidden, unfiltered browse panel on every node edit (the actual current behavior, confirmed by reading nodes/edit.html.erb directly) with a small, name-scoped search endpoint plus create/destroy/update for attach, detach, and reorder. No schema change needed -- RelatedAsset already had everything this requires (asset_id, page_id, an acts_as_list position). search excludes assets already attached to the page, keeping results meaningfully small given hundreds of assets total but only a handful per node in practice. create is find_or_create_by! rather than a bare create!, guarding against the same asset being attached twice from two separate search results. update leans on acts_as_list's own insert_at rather than custom position-shifting logic. Node#editable_page (autosave || draft || head) is extracted since this is now its third call site with identical logic -- deliberately not touching nodes#show, which resolves draft || head without autosave on purpose, a different and correct semantic for "current committed state" versus "what's actively being edited."
3 daysWavy-underline: allowlist to default; destroy-button and search polisherdgeist
Flips the plain-link underline from an opt-in list (growing every time a new context needed it) to the default a rule, with opt-outs living as more specific overrides where something shouldn't look like plain content -- .action_button, the icon nav, the search dropdown's bold results. The allowlist's own history made the case for this: three of its entries were already hand-copied duplicates of the same five properties, and two of those had already silently drifted. form.button_to's icon+text buttons (Destroy, currently) get the same inline-flex/gap treatment .action_button already had -- they were never included in that fix, so they still baseline-aligned an SVG against text instead of centering it, plus an explicit icon size they'd never had either. Dashboard search results: tags render as a wrapped row of pills instead of one-per-line, for visual distinction from page results. The public-preview link and its Revoke button get their own row rather than loose inline flow, which wrapped unpredictably next to a long token URL -- aligned by box-top rather than center or baseline, since a <button> doesn't reliably expose a text baseline the way a plain link does, with a small compensating offset for the button's own internal padding.
3 daysFix search widget input width; remove dead navigation CSSerdgeist
The input's width was calc(100% - 70px), a number tuned to leave room for a "Search: " label that no longer needs to exist -- replaced by a placeholder instead, which also removes the fragile arithmetic entirely rather than re-tuning it. Also picked up a proper border-radius and padding, matching the dashboard's own search input. The width bug's actual proximate cause was a stray #navigation div { float: left } left over from the old text nav, interfering with the icon nav's own flex layout. Going through that whole block with the same scrutiny turned up four more rules worth removing, not fixing: a:hover (identical specificity, later in the file, silently winning the cascade since the icon nav landed), and #metadata/#overview_toggle in the remaining selectors were dead for two different, confirmed reasons -- #overview_toggle was the old wizard's toggle bar, gone along with it, and #metadata here was the pre-details-view subnav toggle, retired before this session and unrelated to the current, still-live #metadata id on the metadata-details section in nodes#edit (a confusing reuse that's caused real problems before).
3 daysUI cleanup pass: search overlay position, remaining table formserdgeist
The search overlay was positioned against the whole viewport (left: 50%, transform: translateX(-50%)) because it sat outside wider text nav it used to center under. Moved inside #navigation, which already has its own positioning context, so it now anchors to the icon nav itself instead of the page center. admin/search_results.html.erb was a bare, unstyled <ul> concatenating title and unique_name into one string by hand. Restyled to match the byline convention already used everywhere else (title_for_node, a separate link_to_path byline with the trailing arrow), and results now link to the node's admin show page rather than straight to edit, matching every other node list in the app instead of being the one exception. menu_items#new and sessions#new (the login page) were the last two views still using the pre-node_content/node_description table-based label/field layout -- found via a grep for the old td.description marker, not guessed at. Converting menu_items#new surfaced a real, separate gap: its input fields have never had a width rule, since the existing 690px rule only applies to a few specifically-named field IDs or anything inside #page_editor, neither of which applies here. Same likely gap probably exists on other simple CRUD forms (users/events/assets/occurrences/pages) -- not fixed here, flagged for its own pass rather than guessed at blind. nodes#new's Create button was pushed to the far right of the page by one stray class (node_content right) no sibling create form carries -- not a family-wide inconsistency, one extra class in one file.
3 daysStyle the new dashboard; consolidate duplicated button/link CSSerdgeist
New rules for the icon nav, search bar, signpost/housekeeping button rows, and the two dashboard widgets. Generalizes .action_button from an anchor-only selector to cover any element, needed once Filter and Search became real buttons rather than submit_tag inputs coincidentally sharing similar values with the generic input[type=submit] fallback. Also folds three hand-copied duplicates of the wavy-underline "plain link" treatment (#flash a, div.pagination a, #menu_item_list td a) into the one shared rule they were always copies of -- two of the three had already silently drifted by missing the -webkit-prefixed property, the actual cost of copying instead of sharing rather than a hypothetical one.
3 daysNormalize action-button wording and add icons app-wideerdgeist
"New X" becomes "Create X" throughout (users, events, assets, menu items, nodes), matching the verb-first pattern the dashboard's own signposts already established, with a shared plus icon rather than a document-flavored one that only made sense next to "post". The "Destroy"/"destroy"/"Delete" family is normalized to "Destroy" everywhere, with a shared trash icon; occurrences#index and pages#index also pick up the destructive button class they'd been silently missing. Filter and Search convert from submit_tag to button_tag, the only way either can hold an icon alongside its label. Edit and the node editor's three dynamic labels (Continue Editing / Edit Draft / Lock + Edit) share one icon without touching their wording -- unlike Destroy's family, the state nuance in the text is real information, not just inconsistent phrasing.
3 daysRebuild the admin dashboard: icon nav, search, signposts, widgetserdgeist
Replaces the old admin#index wizard -- accreted over years, never designed as a whole -- with the dashboard settled on this session: a three-icon nav (dashboard/search/log out, no locale selector), a nodes-first search bar, four task signposts, and two symmetric widgets (drafts/autosaves, recent changes) with a quiet housekeeping row beneath them. Node.recently_changed now filters and orders by the head page's own updated_at instead of the node's blanket timestamp, so a lock/unlock cycle with no actual publish no longer surfaces here, and the original publisher is no longer misattributed to someone else's housekeeping action. This also restores the "published" qualifier on each entry, which the query previously couldn't guarantee was true. @mynodes and its dedicated "My Work" table are retired along with the old wizard -- "Continue my work" is a link to the existing, already- correct NodesController#mine instead of a second, duplicate query. Its one dedicated test (dedup across multiple revisions by the same user) is ported to nodes_controller_test.rb, since mine already carries the same .distinct protection the old query did; it just had no test of its own until now.
3 daysAdd a locale-aware relative-time helper; drop stale locale overrideserdgeist
Node.recently_changed and the new dashboard need "X ago" rendered correctly in both locales. Rails' own distance_of_time_in_words/ time_ago_in_words can't do this on their own -- the scope option changes which translation key is looked up, not the underlying grammar, and German's "vor" requires dative case, which is a different word form than the nominative plural Rails computes by default. relative_time_phrase/relative_distance is a small, from- scratch bucketing helper instead, with an explicit, hand-checked translation table per unit per locale. Also removes de.yml's datetime.distance_in_words and activerecord. errors blocks. Both used the old {{count}}/{{model}} interpolation syntax the current i18n gem no longer recognizes -- it silently leaves the literal placeholder text in the rendered output rather than erroring, which is why this went unnoticed until now. Both were shadowing rails-i18n's own current, correct translations for exactly these keys; deleting the local override lets the gem's version take over instead of maintaining a second, broken copy.
3 daysAdd rails_icons (Tabler) for SVG iconographyerdgeist
Vendors the Tabler outline/filled icon sets via rails_icons' sync mechanism rather than a hand-rolled SVG set or a webfont -- this app had no icon system of any kind before. Icons are committed like any other static asset; re-syncing is only needed when adding an icon that isn't vendored yet, via the new `make sync_icons` target.
3 daysAdd a grouped tag+node search endpoint for the upcoming dashboarderdgeist
AdminController#dashboard_search returns tags and nodes as separate, labeled groups (via ActsAsTaggableOn::Tag.named_like and Node.editor_search) rather than the flat per-node list every existing picker returns. initSearchPicker gains a renderResults callback option that, when given, replaces the default per-node rendering entirely -- lets the dashboard render its two labeled groups without a second, parallel picker implementation. resultsHeaderHtml (the "Press Enter to see all results" hint) is now threaded through as a third argument to renderResults, so a picker with custom rendering can still show it -- previously only the default per-node branch ever did. Tags link straight to the existing /admin/nodes/tags/:tag view rather than becoming an in-place filter chip.
3 daysExtract drafts/recent query logic from controller into Nodeerdgeist
Node.drafts_and_autosaves and Node.recently_changed replace inline query logic in NodesController#drafts/#recent -- pure refactor, no behavior change for either action. The real reason: the dashboard's upcoming abridged widgets need the exact same queries the full pages already use, just limited and (for drafts) sorted with the current user's own locked nodes first. Better to share one method than let a widget and a full page quietly drift onto two versions of "what counts as a current draft." current_user_id: is an explicit, optional argument rather than a separate method -- ordering by lock ownership only applies when a user is given; omitted entirely, it's pure recency, exactly today's behavior. Needed Arel.sql wrapping a sanitized CASE expression before .order would accept it -- sanitize_sql_array only vouches for the values inside the string, a separate Rails safety check still refuses any string shaped like more than a plain column reference unless it's explicitly marked as already-vetted.
3 daysUnify the four field-level pickers, fix search visibilityerdgeist
menu_items/parent_search/move_to_search/event_search each duplicated their own debounce-free AJAX call and result rendering. Replaced with one shared initSearchPicker, taking each picker's distinctive behavior (parent_search's live path preview, event_search's title hint) as a callback rather than a whole reimplementation. Adds a real debounce with an out-of-order-response guard -- none of the four had either before. admin_search (the Alt+F top-bar search) now shares the same function via its own url/isActive/header options, gaining the same guard and fixing an inconsistency of its own (it previously always slid its panel open, even on zero results). Each picker's results container gets its own id instead of sharing was ever supposed to be on screen at once, an assumption with no actual enforcement behind it. Styling moved from an id-pair (#menu_search_results, #search_results) to a shared .search_results class so a future picker never needs this file touched again. menu_search and the admin top-bar search now call Node.editor_search instead of the public, head-only Node.search -- both are admin-only, authenticated views, and had no reason to inherit the public search's "can't find a draft" limitation. The always-ignored :per_page => 1000 on the latter is gone too; Node.search's second argument was never read by the method at all. Also removed a stale #metadata a { text-transform: lowercase } rule, found while verifying the above -- written for the pre-subnav-removal expand-toggle, which no longer exists; it had been silently lowercasing nodes#edit's own, unrelated #metadata div (including move_to_search's results) by id coincidence ever since. #main_navigation and #overview_toggle intentionally left capitalized rather than special-cased -- both belong to the nav bar already slated to shrink to three icons, not worth polishing on the way out.
4 daysGive the sitemap its own view, with collapse and descendant countserdgeist
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.
4 daysRemoving a test script that was accidentally committederdgeist
4 daysAdd drafts/recent/mine/chapters admin node viewserdgeist
Four NodesController actions -- drafts, recent, mine, chapters -- each building its own base scope, sharing one private method (index_matching) for search narrowing and pagination. Wizard rewrite to link into these instead of rendering its own tables is a separate, later step. Node.editor_search backs the shared "q" narrowing: an ILIKE substring match against title/abstract on whichever of head or draft is present, splitting the term on whitespace and requiring every word to match somewhere independently, not as one phrase, since real words can end up separated by markup in the underlying HTML. Deliberately separate from Node.search, the public content search, which stays tsvector-based and head-only. chapters generalizes into /admin/nodes/tags/:tags for an arbitrary tag list (OR'd, not AND'd), sharing the controller action but rendering its own template rather than branching inside one view.