##// END OF EJS Templates
Named routed for RSS/API keys (#20997)....
Jean-Philippe Lang -
r14295:486a4dfbc82a
parent child
Show More
@@ -1,36 +1,36
1 <h3><%=l(:label_my_account)%></h3>
1 <h3><%=l(:label_my_account)%></h3>
2
2
3 <p><%=l(:field_login)%>: <strong><%= link_to_user(@user, :format => :username) %></strong><br />
3 <p><%=l(:field_login)%>: <strong><%= link_to_user(@user, :format => :username) %></strong><br />
4 <%=l(:field_created_on)%>: <%= format_time(@user.created_on) %></p>
4 <%=l(:field_created_on)%>: <%= format_time(@user.created_on) %></p>
5
5
6 <% if @user.own_account_deletable? %>
6 <% if @user.own_account_deletable? %>
7 <p><%= link_to(l(:button_delete_my_account), {:action => 'destroy'}, :class => 'icon icon-del') %></p>
7 <p><%= link_to(l(:button_delete_my_account), {:action => 'destroy'}, :class => 'icon icon-del') %></p>
8 <% end %>
8 <% end %>
9
9
10 <h4><%= l(:label_feeds_access_key) %></h4>
10 <h4><%= l(:label_feeds_access_key) %></h4>
11
11
12 <p>
12 <p>
13 <% if @user.rss_token %>
13 <% if @user.rss_token %>
14 <%= l(:label_feeds_access_key_created_on, distance_of_time_in_words(Time.now, @user.rss_token.created_on)) %>
14 <%= l(:label_feeds_access_key_created_on, distance_of_time_in_words(Time.now, @user.rss_token.created_on)) %>
15 <% else %>
15 <% else %>
16 <%= l(:label_missing_feeds_access_key) %>
16 <%= l(:label_missing_feeds_access_key) %>
17 <% end %>
17 <% end %>
18 (<%= link_to l(:button_reset), {:action => 'reset_rss_key'}, :method => :post %>)
18 (<%= link_to l(:button_reset), my_rss_key_path, :method => :post %>)
19 </p>
19 </p>
20
20
21 <% if Setting.rest_api_enabled? %>
21 <% if Setting.rest_api_enabled? %>
22 <h4><%= l(:label_api_access_key) %></h4>
22 <h4><%= l(:label_api_access_key) %></h4>
23 <div>
23 <div>
24 <%= link_to l(:button_show), {:action => 'show_api_key'}, :remote => true %>
24 <%= link_to l(:button_show), my_api_key_path, :remote => true %>
25 <pre id='api-access-key' class='autoscroll'></pre>
25 <pre id='api-access-key' class='autoscroll'></pre>
26 </div>
26 </div>
27 <%= javascript_tag("$('#api-access-key').hide();") %>
27 <%= javascript_tag("$('#api-access-key').hide();") %>
28 <p>
28 <p>
29 <% if @user.api_token %>
29 <% if @user.api_token %>
30 <%= l(:label_api_access_key_created_on, distance_of_time_in_words(Time.now, @user.api_token.created_on)) %>
30 <%= l(:label_api_access_key_created_on, distance_of_time_in_words(Time.now, @user.api_token.created_on)) %>
31 <% else %>
31 <% else %>
32 <%= l(:label_missing_api_access_key) %>
32 <%= l(:label_missing_api_access_key) %>
33 <% end %>
33 <% end %>
34 (<%= link_to l(:button_reset), {:action => 'reset_api_key'}, :method => :post %>)
34 (<%= link_to l(:button_reset), my_api_key_path, :method => :post %>)
35 </p>
35 </p>
36 <% end %>
36 <% end %>
@@ -1,373 +1,373
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2015 Jean-Philippe Lang
2 # Copyright (C) 2006-2015 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 Rails.application.routes.draw do
18 Rails.application.routes.draw do
19 root :to => 'welcome#index', :as => 'home'
19 root :to => 'welcome#index', :as => 'home'
20
20
21 match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
21 match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
22 match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
22 match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
23 match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register'
23 match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register'
24 match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password'
24 match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password'
25 match 'account/activate', :to => 'account#activate', :via => :get
25 match 'account/activate', :to => 'account#activate', :via => :get
26 get 'account/activation_email', :to => 'account#activation_email', :as => 'activation_email'
26 get 'account/activation_email', :to => 'account#activation_email', :as => 'activation_email'
27
27
28 match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post, :put, :patch]
28 match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post, :put, :patch]
29 match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put, :patch]
29 match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put, :patch]
30 match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put, :patch]
30 match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put, :patch]
31 match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put, :patch]
31 match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put, :patch]
32
32
33 match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
33 match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
34 match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
34 match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
35
35
36 match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
36 match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
37 get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message'
37 get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message'
38 match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post]
38 match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post]
39 get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
39 get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
40
40
41 post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message'
41 post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message'
42 post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply'
42 post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply'
43 post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
43 post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
44 post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
44 post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
45
45
46 # Misc issue routes. TODO: move into resources
46 # Misc issue routes. TODO: move into resources
47 match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
47 match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
48 match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu', :via => [:get, :post]
48 match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu', :via => [:get, :post]
49 match '/issues/changes', :to => 'journals#index', :as => 'issue_changes', :via => :get
49 match '/issues/changes', :to => 'journals#index', :as => 'issue_changes', :via => :get
50 match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue'
50 match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue'
51
51
52 match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get
52 match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get
53 match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post]
53 match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post]
54
54
55 get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt'
55 get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt'
56 get '/issues/gantt', :to => 'gantts#show'
56 get '/issues/gantt', :to => 'gantts#show'
57
57
58 get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar'
58 get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar'
59 get '/issues/calendar', :to => 'calendars#show'
59 get '/issues/calendar', :to => 'calendars#show'
60
60
61 get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report'
61 get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report'
62 get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details'
62 get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details'
63
63
64 get '/issues/imports/new', :to => 'imports#new', :as => 'new_issues_import'
64 get '/issues/imports/new', :to => 'imports#new', :as => 'new_issues_import'
65 post '/imports', :to => 'imports#create', :as => 'imports'
65 post '/imports', :to => 'imports#create', :as => 'imports'
66 get '/imports/:id', :to => 'imports#show', :as => 'import'
66 get '/imports/:id', :to => 'imports#show', :as => 'import'
67 match '/imports/:id/settings', :to => 'imports#settings', :via => [:get, :post], :as => 'import_settings'
67 match '/imports/:id/settings', :to => 'imports#settings', :via => [:get, :post], :as => 'import_settings'
68 match '/imports/:id/mapping', :to => 'imports#mapping', :via => [:get, :post], :as => 'import_mapping'
68 match '/imports/:id/mapping', :to => 'imports#mapping', :via => [:get, :post], :as => 'import_mapping'
69 match '/imports/:id/run', :to => 'imports#run', :via => [:get, :post], :as => 'import_run'
69 match '/imports/:id/run', :to => 'imports#run', :via => [:get, :post], :as => 'import_run'
70
70
71 match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
71 match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
72 match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
72 match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
73 match 'my/page', :controller => 'my', :action => 'page', :via => :get
73 match 'my/page', :controller => 'my', :action => 'page', :via => :get
74 match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
74 match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
75 match 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :via => :post
75 get 'my/api_key', :to => 'my#show_api_key', :as => 'my_api_key'
76 match 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :via => :post
76 post 'my/api_key', :to => 'my#reset_api_key'
77 match 'my/api_key', :controller => 'my', :action => 'show_api_key', :via => :get
77 post 'my/rss_key', :to => 'my#reset_rss_key', :as => 'my_rss_key'
78 match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
78 match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
79 match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get
79 match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get
80 match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
80 match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
81 match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
81 match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
82 match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
82 match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
83
83
84 resources :users do
84 resources :users do
85 resources :memberships, :controller => 'principal_memberships'
85 resources :memberships, :controller => 'principal_memberships'
86 resources :email_addresses, :only => [:index, :create, :update, :destroy]
86 resources :email_addresses, :only => [:index, :create, :update, :destroy]
87 end
87 end
88
88
89 post 'watchers/watch', :to => 'watchers#watch', :as => 'watch'
89 post 'watchers/watch', :to => 'watchers#watch', :as => 'watch'
90 delete 'watchers/watch', :to => 'watchers#unwatch'
90 delete 'watchers/watch', :to => 'watchers#unwatch'
91 get 'watchers/new', :to => 'watchers#new'
91 get 'watchers/new', :to => 'watchers#new'
92 post 'watchers', :to => 'watchers#create'
92 post 'watchers', :to => 'watchers#create'
93 post 'watchers/append', :to => 'watchers#append'
93 post 'watchers/append', :to => 'watchers#append'
94 delete 'watchers', :to => 'watchers#destroy'
94 delete 'watchers', :to => 'watchers#destroy'
95 get 'watchers/autocomplete_for_user', :to => 'watchers#autocomplete_for_user'
95 get 'watchers/autocomplete_for_user', :to => 'watchers#autocomplete_for_user'
96 # Specific routes for issue watchers API
96 # Specific routes for issue watchers API
97 post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
97 post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
98 delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
98 delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
99
99
100 resources :projects do
100 resources :projects do
101 member do
101 member do
102 get 'settings(/:tab)', :action => 'settings', :as => 'settings'
102 get 'settings(/:tab)', :action => 'settings', :as => 'settings'
103 post 'modules'
103 post 'modules'
104 post 'archive'
104 post 'archive'
105 post 'unarchive'
105 post 'unarchive'
106 post 'close'
106 post 'close'
107 post 'reopen'
107 post 'reopen'
108 match 'copy', :via => [:get, :post]
108 match 'copy', :via => [:get, :post]
109 end
109 end
110
110
111 shallow do
111 shallow do
112 resources :memberships, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
112 resources :memberships, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
113 collection do
113 collection do
114 get 'autocomplete'
114 get 'autocomplete'
115 end
115 end
116 end
116 end
117 end
117 end
118
118
119 resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy]
119 resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy]
120
120
121 get 'issues/:copy_from/copy', :to => 'issues#new', :as => 'copy_issue'
121 get 'issues/:copy_from/copy', :to => 'issues#new', :as => 'copy_issue'
122 resources :issues, :only => [:index, :new, :create]
122 resources :issues, :only => [:index, :new, :create]
123 # Used when updating the form of a new issue
123 # Used when updating the form of a new issue
124 post 'issues/new', :to => 'issues#new'
124 post 'issues/new', :to => 'issues#new'
125
125
126 resources :files, :only => [:index, :new, :create]
126 resources :files, :only => [:index, :new, :create]
127
127
128 resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
128 resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
129 collection do
129 collection do
130 put 'close_completed'
130 put 'close_completed'
131 end
131 end
132 end
132 end
133 get 'versions.:format', :to => 'versions#index'
133 get 'versions.:format', :to => 'versions#index'
134 get 'roadmap', :to => 'versions#index', :format => false
134 get 'roadmap', :to => 'versions#index', :format => false
135 get 'versions', :to => 'versions#index'
135 get 'versions', :to => 'versions#index'
136
136
137 resources :news, :except => [:show, :edit, :update, :destroy]
137 resources :news, :except => [:show, :edit, :update, :destroy]
138 resources :time_entries, :controller => 'timelog', :except => [:show, :edit, :update, :destroy] do
138 resources :time_entries, :controller => 'timelog', :except => [:show, :edit, :update, :destroy] do
139 get 'report', :on => :collection
139 get 'report', :on => :collection
140 end
140 end
141 resources :queries, :only => [:new, :create]
141 resources :queries, :only => [:new, :create]
142 shallow do
142 shallow do
143 resources :issue_categories
143 resources :issue_categories
144 end
144 end
145 resources :documents, :except => [:show, :edit, :update, :destroy]
145 resources :documents, :except => [:show, :edit, :update, :destroy]
146 resources :boards
146 resources :boards
147 shallow do
147 shallow do
148 resources :repositories, :except => [:index, :show] do
148 resources :repositories, :except => [:index, :show] do
149 member do
149 member do
150 match 'committers', :via => [:get, :post]
150 match 'committers', :via => [:get, :post]
151 end
151 end
152 end
152 end
153 end
153 end
154
154
155 match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
155 match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
156 resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do
156 resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do
157 member do
157 member do
158 get 'rename'
158 get 'rename'
159 post 'rename'
159 post 'rename'
160 get 'history'
160 get 'history'
161 get 'diff'
161 get 'diff'
162 match 'preview', :via => [:post, :put, :patch]
162 match 'preview', :via => [:post, :put, :patch]
163 post 'protect'
163 post 'protect'
164 post 'add_attachment'
164 post 'add_attachment'
165 end
165 end
166 collection do
166 collection do
167 get 'export'
167 get 'export'
168 get 'date_index'
168 get 'date_index'
169 end
169 end
170 end
170 end
171 match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
171 match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
172 get 'wiki/:id/:version', :to => 'wiki#show', :constraints => {:version => /\d+/}
172 get 'wiki/:id/:version', :to => 'wiki#show', :constraints => {:version => /\d+/}
173 delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
173 delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
174 get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
174 get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
175 get 'wiki/:id/:version/diff', :to => 'wiki#diff'
175 get 'wiki/:id/:version/diff', :to => 'wiki#diff'
176 end
176 end
177
177
178 resources :issues do
178 resources :issues do
179 member do
179 member do
180 # Used when updating the form of an existing issue
180 # Used when updating the form of an existing issue
181 patch 'edit', :to => 'issues#edit'
181 patch 'edit', :to => 'issues#edit'
182 end
182 end
183 collection do
183 collection do
184 match 'bulk_edit', :via => [:get, :post]
184 match 'bulk_edit', :via => [:get, :post]
185 post 'bulk_update'
185 post 'bulk_update'
186 end
186 end
187 resources :time_entries, :controller => 'timelog', :except => [:show, :edit, :update, :destroy] do
187 resources :time_entries, :controller => 'timelog', :except => [:show, :edit, :update, :destroy] do
188 collection do
188 collection do
189 get 'report'
189 get 'report'
190 end
190 end
191 end
191 end
192 shallow do
192 shallow do
193 resources :relations, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
193 resources :relations, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
194 end
194 end
195 end
195 end
196 # Used when updating the form of a new issue outside a project
196 # Used when updating the form of a new issue outside a project
197 post '/issues/new', :to => 'issues#new'
197 post '/issues/new', :to => 'issues#new'
198 match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete
198 match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete
199
199
200 resources :queries, :except => [:show]
200 resources :queries, :except => [:show]
201
201
202 resources :news, :only => [:index, :show, :edit, :update, :destroy]
202 resources :news, :only => [:index, :show, :edit, :update, :destroy]
203 match '/news/:id/comments', :to => 'comments#create', :via => :post
203 match '/news/:id/comments', :to => 'comments#create', :via => :post
204 match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
204 match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
205
205
206 resources :versions, :only => [:show, :edit, :update, :destroy] do
206 resources :versions, :only => [:show, :edit, :update, :destroy] do
207 post 'status_by', :on => :member
207 post 'status_by', :on => :member
208 end
208 end
209
209
210 resources :documents, :only => [:show, :edit, :update, :destroy] do
210 resources :documents, :only => [:show, :edit, :update, :destroy] do
211 post 'add_attachment', :on => :member
211 post 'add_attachment', :on => :member
212 end
212 end
213
213
214 match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu, :via => [:get, :post]
214 match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu, :via => [:get, :post]
215
215
216 resources :time_entries, :controller => 'timelog', :except => :destroy do
216 resources :time_entries, :controller => 'timelog', :except => :destroy do
217 collection do
217 collection do
218 get 'report'
218 get 'report'
219 get 'bulk_edit'
219 get 'bulk_edit'
220 post 'bulk_update'
220 post 'bulk_update'
221 end
221 end
222 end
222 end
223 match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/
223 match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/
224 # TODO: delete /time_entries for bulk deletion
224 # TODO: delete /time_entries for bulk deletion
225 match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete
225 match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete
226 # Used to update the new time entry form
226 # Used to update the new time entry form
227 post '/time_entries/new', :to => 'timelog#new'
227 post '/time_entries/new', :to => 'timelog#new'
228
228
229 get 'projects/:id/activity', :to => 'activities#index', :as => :project_activity
229 get 'projects/:id/activity', :to => 'activities#index', :as => :project_activity
230 get 'activity', :to => 'activities#index'
230 get 'activity', :to => 'activities#index'
231
231
232 # repositories routes
232 # repositories routes
233 get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
233 get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
234 get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
234 get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
235
235
236 get 'projects/:id/repository/:repository_id/changes(/*path)',
236 get 'projects/:id/repository/:repository_id/changes(/*path)',
237 :to => 'repositories#changes',
237 :to => 'repositories#changes',
238 :format => false
238 :format => false
239
239
240 get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
240 get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
241 get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
241 get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
242 post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
242 post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
243 delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
243 delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
244 get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
244 get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
245 get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path)',
245 get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path)',
246 :controller => 'repositories',
246 :controller => 'repositories',
247 :format => false,
247 :format => false,
248 :constraints => {
248 :constraints => {
249 :action => /(browse|show|entry|raw|annotate|diff)/,
249 :action => /(browse|show|entry|raw|annotate|diff)/,
250 :rev => /[a-z0-9\.\-_]+/
250 :rev => /[a-z0-9\.\-_]+/
251 }
251 }
252
252
253 get 'projects/:id/repository/statistics', :to => 'repositories#stats'
253 get 'projects/:id/repository/statistics', :to => 'repositories#stats'
254 get 'projects/:id/repository/graph', :to => 'repositories#graph'
254 get 'projects/:id/repository/graph', :to => 'repositories#graph'
255
255
256 get 'projects/:id/repository/changes(/*path)',
256 get 'projects/:id/repository/changes(/*path)',
257 :to => 'repositories#changes',
257 :to => 'repositories#changes',
258 :format => false
258 :format => false
259
259
260 get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
260 get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
261 get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
261 get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
262 get 'projects/:id/repository/revision', :to => 'repositories#revision'
262 get 'projects/:id/repository/revision', :to => 'repositories#revision'
263 post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue'
263 post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue'
264 delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
264 delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
265 get 'projects/:id/repository/revisions/:rev/:action(/*path)',
265 get 'projects/:id/repository/revisions/:rev/:action(/*path)',
266 :controller => 'repositories',
266 :controller => 'repositories',
267 :format => false,
267 :format => false,
268 :constraints => {
268 :constraints => {
269 :action => /(browse|show|entry|raw|annotate|diff)/,
269 :action => /(browse|show|entry|raw|annotate|diff)/,
270 :rev => /[a-z0-9\.\-_]+/
270 :rev => /[a-z0-9\.\-_]+/
271 }
271 }
272 get 'projects/:id/repository/:repository_id/:action(/*path)',
272 get 'projects/:id/repository/:repository_id/:action(/*path)',
273 :controller => 'repositories',
273 :controller => 'repositories',
274 :action => /(browse|show|entry|raw|changes|annotate|diff)/,
274 :action => /(browse|show|entry|raw|changes|annotate|diff)/,
275 :format => false
275 :format => false
276 get 'projects/:id/repository/:action(/*path)',
276 get 'projects/:id/repository/:action(/*path)',
277 :controller => 'repositories',
277 :controller => 'repositories',
278 :action => /(browse|show|entry|raw|changes|annotate|diff)/,
278 :action => /(browse|show|entry|raw|changes|annotate|diff)/,
279 :format => false
279 :format => false
280
280
281 get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
281 get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
282 get 'projects/:id/repository', :to => 'repositories#show', :path => nil
282 get 'projects/:id/repository', :to => 'repositories#show', :path => nil
283
283
284 # additional routes for having the file name at the end of url
284 # additional routes for having the file name at the end of url
285 get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment'
285 get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment'
286 get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment'
286 get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment'
287 get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/
287 get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/
288 get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail'
288 get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail'
289 resources :attachments, :only => [:show, :destroy]
289 resources :attachments, :only => [:show, :destroy]
290 get 'attachments/:object_type/:object_id/edit', :to => 'attachments#edit', :as => :object_attachments_edit
290 get 'attachments/:object_type/:object_id/edit', :to => 'attachments#edit', :as => :object_attachments_edit
291 patch 'attachments/:object_type/:object_id', :to => 'attachments#update', :as => :object_attachments
291 patch 'attachments/:object_type/:object_id', :to => 'attachments#update', :as => :object_attachments
292
292
293 resources :groups do
293 resources :groups do
294 resources :memberships, :controller => 'principal_memberships'
294 resources :memberships, :controller => 'principal_memberships'
295 member do
295 member do
296 get 'autocomplete_for_user'
296 get 'autocomplete_for_user'
297 end
297 end
298 end
298 end
299
299
300 get 'groups/:id/users/new', :to => 'groups#new_users', :id => /\d+/, :as => 'new_group_users'
300 get 'groups/:id/users/new', :to => 'groups#new_users', :id => /\d+/, :as => 'new_group_users'
301 post 'groups/:id/users', :to => 'groups#add_users', :id => /\d+/, :as => 'group_users'
301 post 'groups/:id/users', :to => 'groups#add_users', :id => /\d+/, :as => 'group_users'
302 delete 'groups/:id/users/:user_id', :to => 'groups#remove_user', :id => /\d+/, :as => 'group_user'
302 delete 'groups/:id/users/:user_id', :to => 'groups#remove_user', :id => /\d+/, :as => 'group_user'
303
303
304 resources :trackers, :except => :show do
304 resources :trackers, :except => :show do
305 collection do
305 collection do
306 match 'fields', :via => [:get, :post]
306 match 'fields', :via => [:get, :post]
307 end
307 end
308 end
308 end
309 resources :issue_statuses, :except => :show do
309 resources :issue_statuses, :except => :show do
310 collection do
310 collection do
311 post 'update_issue_done_ratio'
311 post 'update_issue_done_ratio'
312 end
312 end
313 end
313 end
314 resources :custom_fields, :except => :show
314 resources :custom_fields, :except => :show
315 resources :roles do
315 resources :roles do
316 collection do
316 collection do
317 match 'permissions', :via => [:get, :post]
317 match 'permissions', :via => [:get, :post]
318 end
318 end
319 end
319 end
320 resources :enumerations, :except => :show
320 resources :enumerations, :except => :show
321 match 'enumerations/:type', :to => 'enumerations#index', :via => :get
321 match 'enumerations/:type', :to => 'enumerations#index', :via => :get
322
322
323 get 'projects/:id/search', :controller => 'search', :action => 'index'
323 get 'projects/:id/search', :controller => 'search', :action => 'index'
324 get 'search', :controller => 'search', :action => 'index'
324 get 'search', :controller => 'search', :action => 'index'
325
325
326
326
327 get 'mail_handler', :to => 'mail_handler#new'
327 get 'mail_handler', :to => 'mail_handler#new'
328 post 'mail_handler', :to => 'mail_handler#index'
328 post 'mail_handler', :to => 'mail_handler#index'
329
329
330 get 'admin', :to => 'admin#index'
330 get 'admin', :to => 'admin#index'
331 get 'admin/projects', :to => 'admin#projects'
331 get 'admin/projects', :to => 'admin#projects'
332 get 'admin/plugins', :to => 'admin#plugins'
332 get 'admin/plugins', :to => 'admin#plugins'
333 get 'admin/info', :to => 'admin#info'
333 get 'admin/info', :to => 'admin#info'
334 post 'admin/test_email', :to => 'admin#test_email', :as => 'test_email'
334 post 'admin/test_email', :to => 'admin#test_email', :as => 'test_email'
335 post 'admin/default_configuration', :to => 'admin#default_configuration'
335 post 'admin/default_configuration', :to => 'admin#default_configuration'
336
336
337 resources :auth_sources do
337 resources :auth_sources do
338 member do
338 member do
339 get 'test_connection', :as => 'try_connection'
339 get 'test_connection', :as => 'try_connection'
340 end
340 end
341 collection do
341 collection do
342 get 'autocomplete_for_new_user'
342 get 'autocomplete_for_new_user'
343 end
343 end
344 end
344 end
345
345
346 match 'workflows', :controller => 'workflows', :action => 'index', :via => :get
346 match 'workflows', :controller => 'workflows', :action => 'index', :via => :get
347 match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post]
347 match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post]
348 match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post]
348 match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post]
349 match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post]
349 match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post]
350 match 'settings', :controller => 'settings', :action => 'index', :via => :get
350 match 'settings', :controller => 'settings', :action => 'index', :via => :get
351 match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post]
351 match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post]
352 match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post], :as => 'plugin_settings'
352 match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post], :as => 'plugin_settings'
353
353
354 match 'sys/projects', :to => 'sys#projects', :via => :get
354 match 'sys/projects', :to => 'sys#projects', :via => :get
355 match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
355 match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
356 match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => [:get, :post]
356 match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => [:get, :post]
357
357
358 match 'uploads', :to => 'attachments#upload', :via => :post
358 match 'uploads', :to => 'attachments#upload', :via => :post
359
359
360 get 'robots.txt', :to => 'welcome#robots'
360 get 'robots.txt', :to => 'welcome#robots'
361
361
362 Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
362 Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
363 file = File.join(plugin_dir, "config/routes.rb")
363 file = File.join(plugin_dir, "config/routes.rb")
364 if File.exists?(file)
364 if File.exists?(file)
365 begin
365 begin
366 instance_eval File.read(file)
366 instance_eval File.read(file)
367 rescue Exception => e
367 rescue Exception => e
368 puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}."
368 puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}."
369 exit 1
369 exit 1
370 end
370 end
371 end
371 end
372 end
372 end
373 end
373 end
@@ -1,43 +1,43
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2015 Jean-Philippe Lang
2 # Copyright (C) 2006-2015 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require File.expand_path('../../../test_helper', __FILE__)
18 require File.expand_path('../../../test_helper', __FILE__)
19
19
20 class RoutingMyTest < Redmine::RoutingTest
20 class RoutingMyTest < Redmine::RoutingTest
21 def test_my
21 def test_my
22 should_route 'GET /my/account' => 'my#account'
22 should_route 'GET /my/account' => 'my#account'
23 should_route 'POST /my/account' => 'my#account'
23 should_route 'POST /my/account' => 'my#account'
24
24
25 should_route 'GET /my/account/destroy' => 'my#destroy'
25 should_route 'GET /my/account/destroy' => 'my#destroy'
26 should_route 'POST /my/account/destroy' => 'my#destroy'
26 should_route 'POST /my/account/destroy' => 'my#destroy'
27
27
28 should_route 'GET /my/page' => 'my#page'
28 should_route 'GET /my/page' => 'my#page'
29 should_route 'GET /my' => 'my#index'
29 should_route 'GET /my' => 'my#index'
30
30
31 should_route 'POST /my/reset_rss_key' => 'my#reset_rss_key'
32 should_route 'POST /my/reset_api_key' => 'my#reset_api_key'
33 should_route 'GET /my/api_key' => 'my#show_api_key'
31 should_route 'GET /my/api_key' => 'my#show_api_key'
32 should_route 'POST /my/api_key' => 'my#reset_api_key'
33 should_route 'POST /my/rss_key' => 'my#reset_rss_key'
34
34
35 should_route 'GET /my/password' => 'my#password'
35 should_route 'GET /my/password' => 'my#password'
36 should_route 'POST /my/password' => 'my#password'
36 should_route 'POST /my/password' => 'my#password'
37
37
38 should_route 'GET /my/page_layout' => 'my#page_layout'
38 should_route 'GET /my/page_layout' => 'my#page_layout'
39 should_route 'POST /my/add_block' => 'my#add_block'
39 should_route 'POST /my/add_block' => 'my#add_block'
40 should_route 'POST /my/remove_block' => 'my#remove_block'
40 should_route 'POST /my/remove_block' => 'my#remove_block'
41 should_route 'POST /my/order_blocks' => 'my#order_blocks'
41 should_route 'POST /my/order_blocks' => 'my#order_blocks'
42 end
42 end
43 end
43 end
General Comments 0
You need to be logged in to leave comments. Login now