summaryrefslogtreecommitdiff
path: root/app/models/node.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-12 23:42:43 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-12 23:42:43 +0200
commitb271648f89cba7cafafa1b73b1658b1c1bc0e4b0 (patch)
tree567302b1aa6add08b46e0be028a0972f76c52abc /app/models/node.rb
parentcf93acb8ad44ba9cd486e8f6457d9fd9fbc041cc (diff)
Rebuild the admin dashboard: icon nav, search, signposts, widgets
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.
Diffstat (limited to 'app/models/node.rb')
-rw-r--r--app/models/node.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index aa2f7f3..1d0a089 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -377,10 +377,10 @@ class Node < ApplicationRecord
377 end 377 end
378 378
379 def self.recently_changed 379 def self.recently_changed
380 where( 380 includes(:head).where(
381 "nodes.updated_at < ? AND nodes.updated_at > ? AND nodes.parent_id IS NOT NULL", 381 "pages.updated_at < ? AND pages.updated_at > ? AND nodes.parent_id IS NOT NULL",
382 Time.now, Time.now - 14.days 382 Time.now, Time.now - 14.days
383 ) 383 ).order("pages.updated_at desc").references(:head)
384 end 384 end
385 385
386 protected 386 protected