|
Avalanche2::Application.routes.draw do
# Landing page
root 'start#index'
get 'landing_page' => 'start#landing_page'
# Blog
get "blog" => "blog_posts#index", :as => :blog
get "blog/:id" => "blog_posts#show", :as => :post
# Change Language
get '/change_locale/:locale', to: 'settings#change_locale', as: :change_locale
# Newsletter Subscription
get "subscription/create"
post "subscribe" => "subscription#create", :as => :subscriptions
# Contact
resources :contact_messages, path: '/contact', :as => :contact_messages
# Uploads
resources :uploads
post "upload" => "uploads#upload", :as => :post_upload
# Missions
resources :missions
get 'missions/:id/agents', to: 'missions#show_agents', as: :mission_agents_list
get 'missions/:id/agents/:agent', to: 'missions#show_agent_details', as: :mission_agent_details
get 'missions/:id/agents/:agent/take_agent_role', to: 'missions#take_agent_role', as: :take_agent_role
# Mission Control
get 'missions/:id/mission_control' => 'missions#mission_control', as: :mission_control
get 'missions/:id/mission_control/accept_step_submission/:step_submission_id' => 'missions#accept_step_submission', as: :accept_step_submission
get 'missions/:id/mission_control/reject_step_submission/:step_submission_id' => 'missions#reject_step_submission', as: :reject_step_submission
# Mission Editor
get 'missions/:id/editor' => 'missions#edit', as: :mission_editor
scope 'missions/:mission/editor' do
resources :rewards, :controller => "mission_editor/rewards"
resources :mission_agents, :controller => "mission_editor/agents", path: '/agents'
get '/launch', :controller => "mission_editor/details", :action => "launch", as: :mission_editor_launch
get '/launch_mission', :controller => "mission_editor/details", :action => "launch_mission", as: :launch_mission
post '/sort_steps', :controller => "mission_editor/agents", :action => "sort_steps", as: :sort_agent_steps
end
# get 'missions/:id/editor/rewards' => 'rewards#index', as: :mission_editor_rewards_list
# get 'missions/:id/editor/rewards/new' => 'rewards#new', as: :mission_editor_new_reward
# post 'missions/:id/editor/rewards/create' => 'rewards#create', as: :mission_editor_create_reward
# get 'missions/:id/editor/rewards/:reward/edit' => 'rewards#edit', as: :mission_editor_edit_reward
# post 'missions/:id/editor/rewards/:reward/update' => 'rewards#update', as: :mission_editor_update_reward
# delete 'missions/:id/editor/rewards/:reward/destroy' => 'rewards#destroy', as: :mission_editor_delete_reward
# Agents
get 'dashboard' => 'agents#dashboard', as: :dashboard
get 'dashboard/directing' => 'agents#directing_missions', as: :directing_missions
get 'agents' => 'agents#list', as: :agent_list
get 'agent/:id' => 'agents#show', as: :show_agent
# Invites
get 'invite' => 'invites#invite', as: :invite
post 'send_invite_message' => 'invites#send_invite_message', as: :send_invite_message
get 'resend_invite_message/:id' => 'invites#resend_invite_message', as: :resend_invite_message
# Rewards
get 'dashboard/rewards' => 'agents#rewards', as: :user_rewards
get 'dashboard/rewards/:id/received' => 'agents#received_reward', as: :received_reward
get 'dashboard/rewards/:id/not_received' => 'agents#not_received_reward', as: :not_received_reward
# Steps
get 'missions/:id/agents/:agent/steps/:step/step_submission' => 'missions#step_submission', as: :step_submission
post 'missions/:id/agents/:agent/steps/:step/step_submission' => 'missions#step_submission_with_validations', as: :step_submission_with_validations
# Admin Panel
get "admin/dashboard" => "admin_panel#dashboard", :as => :admin_dashboard
get "admin" => "admin_panel#index"
get "admin/posts" => "admin_panel#posts", :as => :admin_posts
get "admin/contact_messages" => "admin_panel#contact_messages", :as => :admin_contact_messages
get "admin/contact_message/:id" => "admin_panel#show_contact_message", :as => :show_contact_message
get "admin/contact_message/:id/mark_contact_message_as_readed" => "contact_messages#readed", :as => :mark_contact_message_as_readed
get "admin/contact_message/:id/mark_contact_message_as_unread" => "contact_messages#unread", :as => :mark_contact_message_as_unread
get "admin/subscribers" => "admin_panel#subscribers", :as => :admin_subscribers
get "admin/subscribers/export/cvs" => "admin_panel#export_subscribers_list", :as => :export_subscribers_list
get "admin/users" => "admin_panel#users", :as => :admin_users
get "admin/users/:id/make_admin" => "admin_panel#make_admin", :as => :make_admin
get "admin/config" => "admin_panel#site_config", :as => :admin_config
post "admin/config/update" => "admin_panel#site_config_update", :as => :config_update
get '/admin/files' => "admin_panel#files", :as => :admin_files
resources :uploads, path: '/admin/files'
resources :blog_posts, path: '/admin/posts'
get "maintenance_mode" => "admin_panel#maintenance_mode", :as => :maintenance_mode
# Devise Routes
devise_for :users, :skip => [:sessions, :passwords, :confirmations, :registrations], controllers: { invitations: "users/invitations" }
as :user do
get 'login' => 'users/sessions#new', :as => :new_user_session
post 'login' => 'users/sessions#create', :as => :user_session
delete 'logout' => 'devise/sessions#destroy', :as => :destroy_user_session
get 'signup' => 'users/registrations#new', :as => :new_user_registration
post 'signup' => 'users/registrations#create', :as => :user_registration
put 'signup' => 'users/registrations#update', :as => :user_registration_update
scope '/account' do
# password reset
get '/reset-password' => 'users/passwords#new', as: 'new_user_password'
put '/reset-password' => 'users/passwords#update', :as => :user_password
post '/reset-password' => 'users/passwords#create', :as => :reset_password
get '/reset-password/change' => 'users/passwords#edit', as: 'edit_user_password'
# confirmation
get '/confirm' => 'users/confirmations#show', as: 'user_confirmation'
post '/confirm' => 'users/confirmations#create'
get '/confirm/resend' => 'users/confirmations#new', as: 'new_user_confirmation'
# settings & cancellation
get '/cancel' => 'users/registrations#cancel', as: 'cancel_user_registration'
get '/settings' => 'users/registrations#edit', as: 'edit_user_registration'
put '/settings' => 'users/registrations#update', as: 'update_user_registration'
# account deletion
delete 'delete_account' => 'users/registrations#destroy', :as => :delete_user_account
end
end
# Resque webserver
mount Resque::Server.new, :at => "/resque"
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
# root 'welcome#index'
# Example of regular route:
# get 'products/:id' => 'catalog#view'
# Example of named route that can be invoked with purchase_url(id: product.id)
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
# Example resource route (maps HTTP verbs to controller actions automatically):
# resources :products
# Example resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end
# Example resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end
# Example resource route with more complex sub-resources:
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', on: :collection
# end
# end
# Example resource route with concerns:
# concern :toggleable do
# post 'toggle'
# end
# resources :posts, concerns: :toggleable
# resources :photos, concerns: :toggleable
# Example resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
end
|