diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-27 02:53:21 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-27 02:53:21 +0200 |
| commit | 180b5feba092db1339f7bb3217e91f0b22239bc5 (patch) | |
| tree | ed2912eb568639d027e2d54bc4f28c7a9406f7e0 /app/controllers/admin_controller.rb | |
| parent | 102c33264fd1463cd88aa8245413e7b331dd9632 (diff) | |
Surface held locks in the dashboard's work-in-progress widget
A lock with no draft or autosave behind it was invisible to
everyone including its holder, until the next editor collided
with it. work_in_progress now admits those nodes, and the
widget names the holder rather than the last editor on any
locked row.
Also flips the ordering to stalest-first, so a backlog reads as a queue
rather than a feed, and gives the heading a real total: the count came
from the already-limited relation and could never exceed five.
Diffstat (limited to 'app/controllers/admin_controller.rb')
| -rw-r--r-- | app/controllers/admin_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index d9cf1be6..2b35fd20 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb | |||
| @@ -5,7 +5,9 @@ class AdminController < ApplicationController | |||
| 5 | before_action :login_required | 5 | before_action :login_required |
| 6 | 6 | ||
| 7 | def index | 7 | def index |
| 8 | @drafts = Node.drafts_and_autosaves(current_user_id: current_user.id).limit(5) | 8 | scope = Node.work_in_progress(current_user_id: current_user.id) |
| 9 | @drafts_total = scope.reorder(nil).count | ||
| 10 | @drafts = scope.includes(:head, :draft, :lock_owner).limit(5) | ||
| 9 | @actions = NodeAction.order(:occurred_at => :desc, :id => :desc).limit(5) | 11 | @actions = NodeAction.order(:occurred_at => :desc, :id => :desc).limit(5) |
| 10 | end | 12 | end |
| 11 | 13 | ||
