Files
stopwatch/config/routes.rb
T
Claude 78f53d5d5a Running timers page with view/stop permissions
- New top-menu page listing running timers: owner, issue, project,
  activity, start time, time on this run and entry total, oldest first;
  refreshes every minute
- Role permissions "View running timers" and "Stop other users' timers",
  checked against each timer's project; users can always stop their own
- A timer can be stopped at an earlier time (when the person left):
  hours logged after it are taken off the entry, and the comment notes
  who stopped it and when
- Timers now record when they were started (session_started_at); timers
  running from before show "unknown" until restarted
- Integration tests for permissions, project scoping and stopping; unit
  tests for Timer#stop_for

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-29 07:06:08 -04:00

20 lines
591 B
Ruby

resources :stopwatch_timers, only: %i(new create edit update) do
collection do
get :current
post :update_form
end
member do
put :start
put :stop
end
end
get 'stopwatch/running_timers', to: 'stopwatch_running_timers#index', as: :stopwatch_running_timers
post 'stopwatch/running_timers/:user_id/stop', to: 'stopwatch_running_timers#stop', as: :stop_stopwatch_running_timer
scope 'issues/:issue_id' do
post 'timer/start', to: 'stopwatch_issue_timers#start', as: :start_issue_timer
post 'timer/stop', to: 'stopwatch_issue_timers#stop', as: :stop_issue_timer
end