Rails.application.routes.draw do namespace :mobile do resources :users, :only => [] do collection do post :sign_in end end resource :dashboard, :only => :show, :controller => :dashboard resources :organizations, :only => [] do resources :events, :only => :index end resources :events, :only => [:index] do resources :shows, :only => :index end resources :shows, :only => [:index] do resources :orders, :only => :index end resources :orders, :only => [:index, :show] do collection { post :validate } member { post :validate } end resources :tickets, :only => [:show] do collection do post :validate post :unvalidate end member do post :validate post :unvalidate get :order end end end namespace :api do resources :events, :only => :show resources :tickets, :only => :index resources :shows, :only => :show resources :organizations, :only => [] do resources :events resources :shows get :authorization end end scope ':organization_slug' do namespace :store do resources :events, :only => [:show, :index] resources :memberships, :only => [:show, :index] resources :rolling_membership_types, :controller => :membership_types resources :seasonal_membership_types, :controller => :membership_types resources :shows, :only => :show resource :checkout, :only => :create resource :order, :only => :destroy get "order", :to => "orders#show" post "order", :to => "orders#update" get "donate", :to => "donations#index" end end #legacy for now to support the old routes directly to events and shows namespace :store do resources :events, :only => :show, :as => :old_storefront_event resources :shows, :only => :show # resource :checkout, :only => :create resource :checkout, :only => :create do get "dook", :to => "checkouts#dook" end end devise_for :members, :controllers => { :invitations => "members/invitations" } devise_for :users, :controllers => {:sessions => "users/sessions"} devise_scope :user do get "sign_up", :to => "devise/registrations#new" end namespace :members do root :to => "index#index" end resources :organizations do put :tax_info, :on => :member resources :user_memberships member do post :connect end end resources :ticket_offers do collection do post "/new", :to => "ticket_offers#new" get "/create", :to => "ticket_offers#create" end member do get :accept get :decline end end resources :export do collection do get :contacts get :donations get :ticket_sales end end resources :kits, :except => :index do get :alternatives, :on => :collection post :requirements, :on => :collection get :requirements, :on => :collection end resources :membership_kits, :only => [ :edit, :update ] resources :reports, :only => :index resources :statements, :only => [ :index, :show ] do resources :slices, :only => [ :index ] do collection do get :data end end end def people_actions resources :actions resources :memberships do collection do post :bulk_update end end resources :membership_awards, :only => :new ["get_action", "refund_action", "join_action", "hear_action", "say_action", "do_action", "go_action", "give_action"].each { |action_type| resources :actions, :as => action_type } resources :notes resources :phones, :only => [:create, :destroy] resource :address, :only => [:create, :update, :destroy] post 'star/:type/:action_id' => 'people#star', :as => :star post 'tag' => 'people#tag', :as => :new_tag delete 'tag/:tag' => 'people#untag', :as => :untag end resources :people do people_actions end resources :individuals, :controller => :people do people_actions end resources :companies, :controller => :people do people_actions end def shared_search_segment_routes resources :actions, :only => [:new, :create] resources :membership_awards, :only => :new member do post :tag end end resources :searches, :only => [:new, :create, :show] do shared_search_segment_routes collection do get "/create", :to => "searches#create" end end resources :segments, :only => [:index, :show, :create, :destroy] do shared_search_segment_routes end resources :events do member do get :widget get :storefront_link get :resell get :wp_plugin get :prices get :image get :messages end resources :discounts resources :shows do resource :sales, :only => [:new, :create, :show, :update] member do get :door_list post :published post :unpublished end collection do post :built post :on_sale get :calendar get :all, :to => :index, :range => :all get :upcoming end end resource :venue, :only => [:edit, :update] end resources :shows, :only => [] do resources :tickets, shallow: true, :only => [ :new, :create ] do member do put :validated put :unvalidated end collection do delete :delete put :on_sale put :off_sale put :bulk_edit put :change_prices get :set_new_price end end end resources :charts, :only => [:update] do resources :sections end resources :sections do resources :ticket_types, :only => [:new, :create] collection do post :on_sale post :off_sale end end resources :ticket_types, :only => [:edit, :update] resources :orders do resource :assignment, :only => [ :new, :create ] collection do get :sales end member do get :resend end end resources :contributions resources :refunds, :only => [ :new, :create ] resources :exchanges, :only => [ :new, :create ] resources :returns, :only => :create resources :comps, :only => [ :new, :create ] resources :merges, :only => [ :new, :create ] resources :membership_types resources :rolling_membership_types, :controller => :membership_types resources :seasonal_membership_types, :controller => :membership_types resources :membership_awards, :only => :create resources :imports do member do get :approve get :recall end collection do get :template end end resources :discounts_reports, :only => [:index] match '/recent_activity' => 'index#recent_activity', :as => :recent_activity match '/events/:event_id/charts/' => 'events#assign', :as => :assign_chart, :via => "post" match '/dashboard' => 'index#dashboard', :constraints => lambda{|r| r.env["warden"].authenticate?} get ':organization_slug/:controller(/:action(/:id))', controller: /store\/[^\/]+/ root :to => 'index#dashboard' end