/
routes.rb
165 lines (139 loc) · 4.04 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
Alchemy::Engine.routes.draw do
root :to => 'pages#show'
get '/sitemap.xml' => 'pages#sitemap', format: 'xml'
get '/admin' => redirect('admin/dashboard')
get '/admin/dashboard' => 'admin/dashboard#index',
:as => :admin_dashboard
get '/admin/dashboard/info' => 'admin/dashboard#info',
:as => :dashboard_info
get '/admin/help' => 'admin/dashboard#help',
:as => :help
get '/admin/dashboard/update_check' => 'admin/dashboard#update_check',
:as => :update_check
get '/attachment/:id/download(/:name)' => 'attachments#download',
:as => :download_attachment
get '/attachment/:id/show' => 'attachments#show',
:as => :show_attachment
# Picture urls
get "/pictures/:id/show(/:size)(/:crop)(/:crop_from/:crop_size)(/:quality)/:name.:format" => 'pictures#show',
:as => :show_picture
get '/pictures/:id/zoom/:name.:format' => 'pictures#zoom',
:as => :zoom_picture
get "/pictures/:id/thumbnails/:size(/:crop)(/:crop_from/:crop_size)/:name.:format" => 'pictures#thumbnail',
:as => :thumbnail, :defaults => {:format => 'png', :name => "thumbnail"}
get '/admin/leave' => 'admin/base#leave', :as => :leave_admin
resources :messages, :only => [:index, :new, :create]
resources :elements, :only => :show
resources :contents, :only => :show
namespace :api, defaults: {format: 'json'} do
resources :contents, only: [:index, :show]
resources :elements, only: [:index, :show] do
get '/contents' => 'contents#index', as: 'contents'
get '/contents/:name' => 'contents#show', as: 'content'
end
resources :pages, only: [:index] do
get 'elements' => 'elements#index', as: 'elements'
get 'elements/:named' => 'elements#index', as: 'named_elements'
end
get '/pages/*urlname(.:format)' => 'pages#show', as: 'page'
get '/admin/pages/:id(.:format)' => 'pages#show', as: 'preview_page'
end
namespace :admin do
resources :contents do
collection do
post :order
end
end
resources :pages do
resources :elements
collection do
post :order
post :flush
post :copy_language_tree
get :switch_language
get :create_language
get :link
get :sort
end
member do
post :unlock
post :publish
post :fold
post :visit
get :configure
get :preview
get :info
end
end
resources :elements do
resources :contents
collection do
get :list
post :order
end
member do
post :fold
delete :trash
end
end
resources :layoutpages, :only => [:index, :edit]
resources :pictures do
collection do
post :flush, :update_multiple
delete :delete_multiple
get :edit_multiple
end
member do
get :info
delete :remove
end
end
resources :attachments do
member do
get :download
end
end
resources :essence_pictures, :except => [:show, :new, :create] do
collection do
put :assign
end
member do
get :crop
end
end
resources :essence_files, :only => [:edit, :update] do
collection do
put :assign
end
end
resources :legacy_page_urls
resources :languages
resource :clipboard, :only => :index, :controller => 'clipboard' do
collection do
get :index
delete :clear
delete :remove
post :insert
end
end
resource :trash, :only => :index, :controller => 'trash' do
collection do
get :index
delete :clear
end
end
resources :tags do
collection do
get :autocomplete
end
end
resources :sites
end
get '/:lang' => 'pages#show',
:constraints => {:lang => /[a-z]{2}(-[a-z]{2})?/},
:as => :show_language_root
# The page show action has to be last route
get '(/:lang)/*urlname(.:format)' => 'pages#show',
:constraints => {:lang => /[a-z]{2}(-[a-z]{2})?/},
:as => :show_page
end