Implement track requests and add the track organizer role

About track requests:
Create migration that adds the fields submitter_id, state, and
cfp_active to Tracks
Add validations and the self_organized? method to the Track model
Create a new TracksController outide of the admin namespace
Create the relevant views for index, show, new and edit
Modify the admin views for tracks to include extra info for
self-organized tracks

About track organizers:
Create the role when a self-organized track is created
Define track organizer abilities
Modify the roles views and controller to handle the new role

The route for Roles#edit needs to have higher priority than the nested
routes for track roles, otherwise, the word edit in the url is matched
as a track with short_name edit
This commit is contained in:
AEtherC0r3 2017-06-08 12:25:33 +03:00 committed by Stella Rouzi
parent 98fc1137e1
commit 68fc750e9f
26 changed files with 766 additions and 27 deletions

View file

@ -54,7 +54,11 @@ Osem::Application.routes.draw do
resource :registration_period
resource :program do
resources :cfps
resources :tracks
resources :tracks do
member do
patch :toggle_cfp_inclusion
end
end
resources :event_types
resources :difficulty_levels
resources :events do
@ -82,9 +86,15 @@ Osem::Application.routes.draw do
resources :campaigns, except: [:show]
resources :emails, only: [:show, :update, :index]
resources :physical_ticket, only: [:index]
resources :roles, except: [ :new, :create ] do
resources :roles, only: [:edit]
resources :roles, except: [ :new, :create, :edit ] do
member do
post :toggle_user
get ':track_name' => 'roles#show', as: 'track'
get ':track_name/edit' => 'roles#edit', as: 'track_edit'
patch ':track_name' => 'roles#update'
put ':track_name' => 'roles#update'
post ':track_name/toggle_user' => 'roles#toggle_user', as: 'toggle_user_track'
end
end
@ -120,6 +130,7 @@ Osem::Application.routes.draw do
patch '/restart' => 'proposals#restart'
end
end
resources :tracks, except: :destroy
end
# TODO: change conference_registrations to singular resource