-
Notifications
You must be signed in to change notification settings - Fork 17
/
routes.rb
40 lines (33 loc) · 2.5 KB
/
routes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
ActionController::Routing::Routes.draw do |map|
map.namespace :admin, :path_prefix => 'admin/readers' do |admin|
admin.resources :messages, :member => [:preview, :deliver]
admin.resources :groups, :has_many => [:memberships, :permissions, :group_invitations, :messages]
admin.resource :reader_configuration, :controller => 'reader_configuration'
admin.toggle_group_membership "memberships/toggle", :controller => 'memberships', :action => 'toggle'
admin.toggle_group_permission "permissions/toggle", :controller => 'permissions', :action => 'toggle'
end
map.namespace :admin do |admin|
admin.resources :readers, :except => [:show]
end
readers_prefix = Radiant.config['reader.profiles_path'] || "/directory"
map.resources :readers, :controller => 'accounts', :path_prefix => readers_prefix
map.resources :messages, :only => [:index, :show], :member => [:preview], :path_prefix => readers_prefix
map.resources :groups, :path_prefix => readers_prefix do |group|
group.resources :messages, :only => [:index, :show], :member => [:preview]
end
accounts_prefix = Radiant.config['reader.preferences_path'] || "/account"
map.resource :reader_session, :path_prefix => accounts_prefix
map.resource :reader_activation, :only => [:show, :new], :path_prefix => accounts_prefix
map.resource :password_reset, :path_prefix => accounts_prefix
map.activate_me "#{accounts_prefix}/activate/:id/:activation_code", :controller => 'reader_activations', :action => 'update'
map.repassword_me "#{accounts_prefix}/repassword/:id/:confirmation_code", :controller => 'password_resets', :action => 'edit'
map.reader_register "#{accounts_prefix}/register", :controller => 'accounts', :action => 'new'
map.reader_login "#{accounts_prefix}/login", :controller => 'reader_sessions', :action => 'new'
map.reader_logout "#{accounts_prefix}/logout", :controller => 'reader_sessions', :action => 'destroy'
map.reader_account "#{accounts_prefix}/preferences", :controller => 'accounts', :action => 'edit'
map.reader_profile "#{readers_prefix}/profile", :controller => 'accounts', :action => 'show'
map.reader_edit_profile "#{accounts_prefix}/edit_profile", :controller => 'accounts', :action => 'edit_profile'
map.reader_permission_denied "#{accounts_prefix}/permission_denied", :controller => 'accounts', :action => 'permission_denied'
map.reader_index readers_prefix, :controller => 'accounts', :action => 'index'
map.reader_dashboard accounts_prefix, :controller => 'accounts', :action => 'dashboard'
end