ruling_timer/config/routes.rb

59 lines
2.1 KiB
Ruby
Raw Normal View History

2021-07-21 07:37:06 +00:00
Rails.application.routes.draw do
locales = Site.first.in_use_locales rescue I18n.available_locales
2021-07-22 08:44:58 +00:00
begin
s = Site.first
save_flag = false
if !s.orbit_bar_extra_render_files_inside.include?("ruling_timers/timer_button")
s.orbit_bar_extra_render_files_inside << "ruling_timers/timer_button"
save_flag = true
end
if !s.orbit_bar_extra_render_files_outside.include?("ruling_timers/timer_window")
s.orbit_bar_extra_render_files_outside << "ruling_timers/timer_window"
save_flag = true
end
s.save if save_flag
rescue => e
puts e.to_s
end
2021-07-21 07:37:06 +00:00
namespace :admin do
resources :ruling_timers do
member do
post "delete_history"
get "add_history"
get "work_history"
get "edit_timer"
get "edit_temp_timer"
patch "update_timer"
patch "update_task"
get "edit_task"
post "delete_task"
get "view_task"
end
collection do
post "create_history"
patch "create_history"
get "timer_management"
get "task_management"
get "add_task"
post "create_task"
patch "create_task"
end
end
end
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
post "/xhr/ruling_timer/start" => "ruling_timers#start"
post "/xhr/ruling_timer/stop" => "ruling_timers#stop"
post "/xhr/ruling_timer/rest" => "ruling_timers#rest"
post "/xhr/ruling_timer/set_summary" => "ruling_timers#set_summary"
post "/xhr/ruling_timer/add_task" => "ruling_timers#add_task"
post "/xhr/ruling_timer/add_task_from_list" => "ruling_timers#add_task_from_list"
post "/xhr/ruling_timer/remove_task" => "ruling_timers#remove_task"
post "/xhr/ruling_timer/set_task_status" => "ruling_timers#set_task_status"
post "/xhr/ruling_timer/start_task" => "ruling_timers#start_task"
post "/xhr/ruling_timer/stop_task" => "ruling_timers#stop_task"
post "/xhr/ruling_timer/add_event" => "ruling_timers#add_event"
post "/xhr/ruling_timer/delete_event" => "ruling_timers#delete_event"
post "/xhr/ruling_timer/get_work_times" => "ruling_timers#get_work_times"
post "/xhr/ruling_timer/save_work_times" => "ruling_timers#save_work_times"
end
end