2011-10-30 23:02:41 +00:00
|
|
|
Locomotive::Engine.routes.draw do
|
2011-01-11 11:42:12 +00:00
|
|
|
|
2011-11-09 01:35:59 +00:00
|
|
|
# authentication
|
2011-11-04 15:55:51 +00:00
|
|
|
devise_for :locomotive_account,
|
|
|
|
:class_name => 'Locomotive::Account',
|
|
|
|
:path => '',
|
|
|
|
:path_prefix => nil,
|
2011-11-06 11:18:34 +00:00
|
|
|
:failure_app => 'Locomotive::Devise::FailureApp',
|
2011-11-04 15:55:51 +00:00
|
|
|
:controllers => { :sessions => 'locomotive/sessions', :passwords => 'locomotive/passwords' } do
|
2012-01-30 09:56:38 +00:00
|
|
|
match '/' => 'sessions#new'
|
|
|
|
delete 'signout' => 'sessions#destroy', :as => :destroy_locomotive_session
|
2011-11-03 13:01:08 +00:00
|
|
|
end
|
|
|
|
|
2011-11-04 15:55:51 +00:00
|
|
|
root :to => 'pages#index'
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
resources :pages do
|
|
|
|
put :sort, :on => :member
|
|
|
|
get :get_path, :on => :collection
|
|
|
|
end
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
resources :snippets
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
resources :sites
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
resource :current_site, :controller => 'current_site'
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
resources :accounts
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
resource :my_account, :controller => 'my_account'
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
resources :memberships
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
resources :theme_assets do
|
|
|
|
get :all, :action => 'index', :on => :collection, :defaults => { :all => true }
|
|
|
|
end
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-11-18 23:20:37 +00:00
|
|
|
resources :content_assets
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
resources :content_types
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-12-22 23:45:32 +00:00
|
|
|
resources :content_entries, :path => 'content_types/:slug/entries' do
|
2011-10-30 23:02:41 +00:00
|
|
|
put :sort, :on => :collection
|
|
|
|
end
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
# installation guide
|
2011-11-06 11:18:34 +00:00
|
|
|
match '/installation' => 'installation#show', :defaults => { :step => 1 }, :as => :installation
|
2011-10-30 23:02:41 +00:00
|
|
|
match '/installation/:step' => 'installation#show', :as => :installation_step
|
2012-01-23 08:05:50 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
end
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
Rails.application.routes.draw do
|
2012-01-23 08:05:50 +00:00
|
|
|
|
2012-01-24 20:16:53 +00:00
|
|
|
# API
|
|
|
|
namespace :locomotive, :module => 'locomotive' do
|
|
|
|
namespace :api do
|
2012-01-23 08:05:50 +00:00
|
|
|
|
|
|
|
resources :tokens, :only => [:create, :destroy]
|
|
|
|
|
|
|
|
resources :theme_assets
|
|
|
|
|
2012-01-24 20:16:53 +00:00
|
|
|
resources :content_assets
|
|
|
|
|
2012-01-23 08:05:50 +00:00
|
|
|
resources :snippets
|
|
|
|
|
2012-01-24 00:00:41 +00:00
|
|
|
resources :pages
|
|
|
|
|
2012-01-24 20:16:53 +00:00
|
|
|
resources :content_types
|
|
|
|
|
2012-01-24 20:33:34 +00:00
|
|
|
resources :content_entries, :path => 'content_types/:slug/entries'
|
|
|
|
|
2012-02-09 10:36:10 +00:00
|
|
|
resource :current_site, :controller => 'current_site'
|
|
|
|
|
2012-01-23 08:05:50 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-07-13 00:46:17 +00:00
|
|
|
# sitemap
|
2012-01-09 14:49:59 +00:00
|
|
|
match '/sitemap.xml' => 'locomotive/public/sitemaps#show', :format => 'xml'
|
2010-07-22 22:10:40 +00:00
|
|
|
|
2011-07-05 20:34:15 +00:00
|
|
|
# robots.txt
|
2012-01-09 14:49:59 +00:00
|
|
|
match '/robots.txt' => 'locomotive/public/robots#show', :format => 'txt'
|
|
|
|
|
|
|
|
# public content entry submissions
|
|
|
|
resources :locomotive_entry_submissions, :controller => 'locomotive/public/content_entries', :path => 'entry_submissions/:slug'
|
2011-07-05 20:34:15 +00:00
|
|
|
|
2010-05-12 00:16:39 +00:00
|
|
|
# magic urls
|
2012-01-26 01:33:39 +00:00
|
|
|
match '/_admin' => 'locomotive/public/pages#show_toolbar'
|
|
|
|
match ':locale/_admin' => 'locomotive/public/pages#show_toolbar', :locale => /(#{Locomotive.config.site_locales.join('|')})/
|
|
|
|
match ':locale/*path/_admin' => 'locomotive/public/pages#show_toolbar', :locale => /(#{Locomotive.config.site_locales.join('|')})/
|
|
|
|
match '*path/_admin' => 'locomotive/public/pages#show_toolbar'
|
|
|
|
|
|
|
|
match '/_edit' => 'locomotive/public/pages#edit'
|
|
|
|
match ':locale/_edit' => 'locomotive/public/pages#edit', :page_path => 'index', :locale => /(#{Locomotive.config.site_locales.join('|')})/
|
|
|
|
match ':locale/*path/_edit' => 'locomotive/public/pages#edit', :locale => /(#{Locomotive.config.site_locales.join('|')})/
|
|
|
|
match '*path/_edit' => 'locomotive/public/pages#edit'
|
|
|
|
|
2012-01-25 15:43:58 +00:00
|
|
|
root :to => 'locomotive/public/pages#show'
|
2012-01-26 01:33:39 +00:00
|
|
|
match ':locale' => 'locomotive/public/pages#show', :page_path => 'index', :locale => /(#{Locomotive.config.site_locales.join('|')})/
|
|
|
|
match ':locale/*path' => 'locomotive/public/pages#show', :locale => /(#{Locomotive.config.site_locales.join('|')})/
|
|
|
|
match '*path' => 'locomotive/public/pages#show'
|
2012-01-25 15:43:58 +00:00
|
|
|
end
|