##// END OF EJS Templates
Code cleanup, use named routes....
Jean-Philippe Lang -
r10847:4ac43ab87631
parent child
Show More
@@ -1,38 +1,43
1 # encoding: utf-8
1 # encoding: utf-8
2 #
2 #
3 # Redmine - project management software
3 # Redmine - project management software
4 # Copyright (C) 2006-2012 Jean-Philippe Lang
4 # Copyright (C) 2006-2012 Jean-Philippe Lang
5 #
5 #
6 # This program is free software; you can redistribute it and/or
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
9 # of the License, or (at your option) any later version.
10 #
10 #
11 # This program is distributed in the hope that it will be useful,
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
14 # GNU General Public License for more details.
15 #
15 #
16 # You should have received a copy of the GNU General Public License
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
19
20 module ReportsHelper
20 module ReportsHelper
21
21
22 def aggregate(data, criteria)
22 def aggregate(data, criteria)
23 a = 0
23 a = 0
24 data.each { |row|
24 data.each { |row|
25 match = 1
25 match = 1
26 criteria.each { |k, v|
26 criteria.each { |k, v|
27 match = 0 unless (row[k].to_s == v.to_s) || (k == 'closed' && row[k] == (v == 0 ? "f" : "t"))
27 match = 0 unless (row[k].to_s == v.to_s) || (k == 'closed' && row[k] == (v == 0 ? "f" : "t"))
28 } unless criteria.nil?
28 } unless criteria.nil?
29 a = a + row["total"].to_i if match == 1
29 a = a + row["total"].to_i if match == 1
30 } unless data.nil?
30 } unless data.nil?
31 a
31 a
32 end
32 end
33
33
34 def aggregate_link(data, criteria, *args)
34 def aggregate_link(data, criteria, *args)
35 a = aggregate data, criteria
35 a = aggregate data, criteria
36 a > 0 ? link_to(h(a), *args) : '-'
36 a > 0 ? link_to(h(a), *args) : '-'
37 end
37 end
38
39 def aggregate_path(project, field, row, options={})
40 parameters = {:set_filter => 1, :subproject_id => '!*', field => row.id}.merge(options)
41 project_issues_path(row.is_a?(Project) ? row : project, parameters)
42 end
38 end
43 end
@@ -1,31 +1,39
1 # encoding: utf-8
1 # encoding: utf-8
2 #
2 #
3 # Redmine - project management software
3 # Redmine - project management software
4 # Copyright (C) 2006-2012 Jean-Philippe Lang
4 # Copyright (C) 2006-2012 Jean-Philippe Lang
5 #
5 #
6 # This program is free software; you can redistribute it and/or
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
9 # of the License, or (at your option) any later version.
10 #
10 #
11 # This program is distributed in the hope that it will be useful,
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
14 # GNU General Public License for more details.
15 #
15 #
16 # You should have received a copy of the GNU General Public License
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
19
20 module RoutesHelper
20 module RoutesHelper
21
21
22 # Returns the path to project issues or to the cross-project
22 # Returns the path to project issues or to the cross-project
23 # issue list if project is nil
23 # issue list if project is nil
24 def _project_issues_path(project, *args)
24 def _project_issues_path(project, *args)
25 if project
25 if project
26 project_issues_path(project, *args)
26 project_issues_path(project, *args)
27 else
27 else
28 issues_path(*args)
28 issues_path(*args)
29 end
29 end
30 end
30 end
31
32 def _project_calendar_path(project, *args)
33 project ? project_calendar_path(project, *args) : issues_calendar_path(*args)
34 end
35
36 def _project_gantt_path(project, *args)
37 project ? project_gantt_path(project, *args) : issues_gantt_path(*args)
38 end
31 end
39 end
@@ -1,17 +1,17
1 <h3><%= l(:label_issue_plural) %></h3>
1 <h3><%= l(:label_issue_plural) %></h3>
2 <%= link_to l(:label_issue_view_all), { :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 } %><br />
2 <%= link_to l(:label_issue_view_all), _project_issues_path(@project, :set_filter => 1) %><br />
3 <% if @project %>
3 <% if @project %>
4 <%= link_to l(:field_summary), :controller => 'reports', :action => 'issue_report', :id => @project %><br />
4 <%= link_to l(:field_summary), project_issues_report_path(@project) %><br />
5 <% end %>
5 <% end %>
6 <%= call_hook(:view_issues_sidebar_issues_bottom) %>
6 <%= call_hook(:view_issues_sidebar_issues_bottom) %>
7
7
8 <% if User.current.allowed_to?(:view_calendar, @project, :global => true) %>
8 <% if User.current.allowed_to?(:view_calendar, @project, :global => true) %>
9 <%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %><br />
9 <%= link_to l(:label_calendar), _project_calendar_path(@project) %><br />
10 <% end %>
10 <% end %>
11 <% if User.current.allowed_to?(:view_gantt, @project, :global => true) %>
11 <% if User.current.allowed_to?(:view_gantt, @project, :global => true) %>
12 <%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %><br />
12 <%= link_to l(:label_gantt), _project_gantt_path(@project) %><br />
13 <% end %>
13 <% end %>
14 <%= call_hook(:view_issues_sidebar_planning_bottom) %>
14 <%= call_hook(:view_issues_sidebar_planning_bottom) %>
15
15
16 <%= render_sidebar_queries %>
16 <%= render_sidebar_queries %>
17 <%= call_hook(:view_issues_sidebar_queries_bottom) %>
17 <%= call_hook(:view_issues_sidebar_queries_bottom) %>
@@ -1,53 +1,30
1 <% if @statuses.empty? or rows.empty? %>
1 <% if @statuses.empty? or rows.empty? %>
2 <p><i><%=l(:label_no_data)%></i></p>
2 <p><i><%=l(:label_no_data)%></i></p>
3 <% else %>
3 <% else %>
4 <% col_width = 70 / (@statuses.length+3) %>
4 <% col_width = 70 / (@statuses.length+3) %>
5 <table class="list">
5 <table class="list">
6 <thead><tr>
6 <thead><tr>
7 <th style="width:25%"></th>
7 <th style="width:25%"></th>
8 <% for status in @statuses %>
8 <% for status in @statuses %>
9 <th style="width:<%= col_width %>%"><%=h status.name %></th>
9 <th style="width:<%= col_width %>%"><%=h status.name %></th>
10 <% end %>
10 <% end %>
11 <th align="center" style="width:<%= col_width %>%"><strong><%=l(:label_open_issues_plural)%></strong></th>
11 <th align="center" style="width:<%= col_width %>%"><strong><%=l(:label_open_issues_plural)%></strong></th>
12 <th align="center" style="width:<%= col_width %>%"><strong><%=l(:label_closed_issues_plural)%></strong></th>
12 <th align="center" style="width:<%= col_width %>%"><strong><%=l(:label_closed_issues_plural)%></strong></th>
13 <th align="center" style="width:<%= col_width %>%"><strong><%=l(:label_total)%></strong></th>
13 <th align="center" style="width:<%= col_width %>%"><strong><%=l(:label_total)%></strong></th>
14 </tr></thead>
14 </tr></thead>
15 <tbody>
15 <tbody>
16 <% for row in rows %>
16 <% for row in rows %>
17 <tr class="<%= cycle("odd", "even") %>">
17 <tr class="<%= cycle("odd", "even") %>">
18 <td><%= link_to h(row.name), :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
18 <td><%= link_to h(row.name), aggregate_path(@project, field_name, row) %></td>
19 :set_filter => 1,
20 :subproject_id => '!*',
21 "#{field_name}" => row.id %></td>
22 <% for status in @statuses %>
19 <% for status in @statuses %>
23 <td align="center"><%= aggregate_link data, { field_name => row.id, "status_id" => status.id },
20 <td align="center"><%= aggregate_link data, { field_name => row.id, "status_id" => status.id }, aggregate_path(@project, field_name, row, :status_id => status.id) %></td>
24 :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
25 :set_filter => 1,
26 :subproject_id => '!*',
27 "status_id" => status.id,
28 "#{field_name}" => row.id %></td>
29 <% end %>
21 <% end %>
30 <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 0 },
22 <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 0 }, aggregate_path(@project, field_name, row, :status_id => "o") %></td>
31 :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
23 <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 1 }, aggregate_path(@project, field_name, row, :status_id => "c") %></td>
32 :set_filter => 1,
24 <td align="center"><%= aggregate_link data, { field_name => row.id }, aggregate_path(@project, field_name, row, :status_id => "*") %></td>
33 :subproject_id => '!*',
34 "#{field_name}" => row.id,
35 "status_id" => "o" %></td>
36 <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 1 },
37 :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
38 :set_filter => 1,
39 :subproject_id => '!*',
40 "#{field_name}" => row.id,
41 "status_id" => "c" %></td>
42 <td align="center"><%= aggregate_link data, { field_name => row.id },
43 :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
44 :set_filter => 1,
45 :subproject_id => '!*',
46 "#{field_name}" => row.id,
47 "status_id" => "*" %></td>
48 </tr>
25 </tr>
49 <% end %>
26 <% end %>
50 </tbody>
27 </tbody>
51 </table>
28 </table>
52 <% end
29 <% end
53 reset_cycle %>
30 reset_cycle %>
@@ -1,41 +1,23
1 <% if @statuses.empty? or rows.empty? %>
1 <% if @statuses.empty? or rows.empty? %>
2 <p><i><%=l(:label_no_data)%></i></p>
2 <p><i><%=l(:label_no_data)%></i></p>
3 <% else %>
3 <% else %>
4 <table class="list">
4 <table class="list">
5 <thead><tr>
5 <thead><tr>
6 <th style="width:25%"></th>
6 <th style="width:25%"></th>
7 <th align="center" style="width:25%"><%=l(:label_open_issues_plural)%></th>
7 <th align="center" style="width:25%"><%=l(:label_open_issues_plural)%></th>
8 <th align="center" style="width:25%"><%=l(:label_closed_issues_plural)%></th>
8 <th align="center" style="width:25%"><%=l(:label_closed_issues_plural)%></th>
9 <th align="center" style="width:25%"><%=l(:label_total)%></th>
9 <th align="center" style="width:25%"><%=l(:label_total)%></th>
10 </tr></thead>
10 </tr></thead>
11 <tbody>
11 <tbody>
12 <% for row in rows %>
12 <% for row in rows %>
13 <tr class="<%= cycle("odd", "even") %>">
13 <tr class="<%= cycle("odd", "even") %>">
14 <td><%= link_to h(row.name), :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
14 <td><%= link_to h(row.name), aggregate_path(@project, field_name, row) %></td>
15 :set_filter => 1,
15 <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 0 }, aggregate_path(@project, field_name, row, :status_id => "o") %></td>
16 :subproject_id => '!*',
16 <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 1 }, aggregate_path(@project, field_name, row, :status_id => "c") %></td>
17 "#{field_name}" => row.id %></td>
17 <td align="center"><%= aggregate_link data, { field_name => row.id }, aggregate_path(@project, field_name, row, :status_id => "*") %></td>
18 <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 0 },
19 :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
20 :set_filter => 1,
21 :subproject_id => '!*',
22 "#{field_name}" => row.id,
23 "status_id" => "o" %></td>
24 <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 1 },
25 :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
26 :set_filter => 1,
27 :subproject_id => '!*',
28 "#{field_name}" => row.id,
29 "status_id" => "c" %></td>
30 <td align="center"><%= aggregate_link data, { field_name => row.id },
31 :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
32 :set_filter => 1,
33 :subproject_id => '!*',
34 "#{field_name}" => row.id,
35 "status_id" => "*" %></td>
36 </tr>
18 </tr>
37 <% end %>
19 <% end %>
38 </tbody>
20 </tbody>
39 </table>
21 </table>
40 <% end
22 <% end
41 reset_cycle %>
23 reset_cycle %>
@@ -1,33 +1,33
1 <h2><%=l(:label_report_plural)%></h2>
1 <h2><%=l(:label_report_plural)%></h2>
2
2
3 <div class="splitcontentleft">
3 <div class="splitcontentleft">
4 <h3><%=l(:field_tracker)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'tracker' %></h3>
4 <h3><%=l(:field_tracker)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'tracker') %></h3>
5 <%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %>
5 <%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %>
6 <br />
6 <br />
7 <h3><%=l(:field_priority)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'priority' %></h3>
7 <h3><%=l(:field_priority)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'priority') %></h3>
8 <%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
8 <%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
9 <br />
9 <br />
10 <h3><%=l(:field_assigned_to)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'assigned_to' %></h3>
10 <h3><%=l(:field_assigned_to)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'assigned_to') %></h3>
11 <%= render :partial => 'simple', :locals => { :data => @issues_by_assigned_to, :field_name => "assigned_to_id", :rows => @assignees } %>
11 <%= render :partial => 'simple', :locals => { :data => @issues_by_assigned_to, :field_name => "assigned_to_id", :rows => @assignees } %>
12 <br />
12 <br />
13 <h3><%=l(:field_author)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'author' %></h3>
13 <h3><%=l(:field_author)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'author') %></h3>
14 <%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %>
14 <%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %>
15 <br />
15 <br />
16 <%= call_hook(:view_reports_issue_report_split_content_left, :project => @project) %>
16 <%= call_hook(:view_reports_issue_report_split_content_left, :project => @project) %>
17 </div>
17 </div>
18
18
19 <div class="splitcontentright">
19 <div class="splitcontentright">
20 <h3><%=l(:field_version)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'version' %></h3>
20 <h3><%=l(:field_version)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'version') %></h3>
21 <%= render :partial => 'simple', :locals => { :data => @issues_by_version, :field_name => "fixed_version_id", :rows => @versions } %>
21 <%= render :partial => 'simple', :locals => { :data => @issues_by_version, :field_name => "fixed_version_id", :rows => @versions } %>
22 <br />
22 <br />
23 <% if @project.children.any? %>
23 <% if @project.children.any? %>
24 <h3><%=l(:field_subproject)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'subproject' %></h3>
24 <h3><%=l(:field_subproject)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'subproject') %></h3>
25 <%= render :partial => 'simple', :locals => { :data => @issues_by_subproject, :field_name => "project_id", :rows => @subprojects } %>
25 <%= render :partial => 'simple', :locals => { :data => @issues_by_subproject, :field_name => "project_id", :rows => @subprojects } %>
26 <br />
26 <br />
27 <% end %>
27 <% end %>
28 <h3><%=l(:field_category)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'category' %></h3>
28 <h3><%=l(:field_category)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'category') %></h3>
29 <%= render :partial => 'simple', :locals => { :data => @issues_by_category, :field_name => "category_id", :rows => @categories } %>
29 <%= render :partial => 'simple', :locals => { :data => @issues_by_category, :field_name => "category_id", :rows => @categories } %>
30 <br />
30 <br />
31 <%= call_hook(:view_reports_issue_report_split_content_right, :project => @project) %>
31 <%= call_hook(:view_reports_issue_report_split_content_right, :project => @project) %>
32 </div>
32 </div>
33
33
@@ -1,7 +1,7
1 <h2><%=l(:label_report_plural)%></h2>
1 <h2><%=l(:label_report_plural)%></h2>
2
2
3 <h3><%=@report_title%></h3>
3 <h3><%=@report_title%></h3>
4 <%= render :partial => 'details', :locals => { :data => @data, :field_name => @field, :rows => @rows } %>
4 <%= render :partial => 'details', :locals => { :data => @data, :field_name => @field, :rows => @rows } %>
5 <br />
5 <br />
6 <%= link_to l(:button_back), :action => 'issue_report' %>
6 <%= link_to l(:button_back), project_issues_report_path(@project) %>
7
7
@@ -1,341 +1,341
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang
2 # Copyright (C) 2006-2012 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 RedmineApp::Application.routes.draw do
18 RedmineApp::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
26
27 match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post]
27 match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post]
28 match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post]
28 match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post]
29 match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post]
29 match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post]
30 match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post]
30 match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post]
31
31
32 match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
32 match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
33 match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
33 match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
34
34
35 match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
35 match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
36 get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message'
36 get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message'
37 match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post]
37 match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post]
38 get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
38 get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
39
39
40 post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message'
40 post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message'
41 post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply'
41 post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply'
42 post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
42 post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
43 post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
43 post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
44
44
45 # Misc issue routes. TODO: move into resources
45 # Misc issue routes. TODO: move into resources
46 match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
46 match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
47 match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu', :via => [:get, :post]
47 match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu', :via => [:get, :post]
48 match '/issues/changes', :to => 'journals#index', :as => 'issue_changes', :via => :get
48 match '/issues/changes', :to => 'journals#index', :as => 'issue_changes', :via => :get
49 match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue'
49 match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue'
50
50
51 match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get
51 match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get
52 match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post]
52 match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post]
53
53
54 get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt'
54 get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt'
55 get '/issues/gantt', :to => 'gantts#show'
55 get '/issues/gantt', :to => 'gantts#show'
56
56
57 get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar'
57 get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar'
58 get '/issues/calendar', :to => 'calendars#show'
58 get '/issues/calendar', :to => 'calendars#show'
59
59
60 match 'projects/:id/issues/report', :to => 'reports#issue_report', :via => :get
60 get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report'
61 match 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :via => :get
61 get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details'
62
62
63 match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
63 match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
64 match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
64 match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
65 match 'my/page', :controller => 'my', :action => 'page', :via => :get
65 match 'my/page', :controller => 'my', :action => 'page', :via => :get
66 match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
66 match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
67 match 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :via => :post
67 match 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :via => :post
68 match 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :via => :post
68 match 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :via => :post
69 match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
69 match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
70 match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get
70 match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get
71 match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
71 match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
72 match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
72 match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
73 match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
73 match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
74
74
75 resources :users
75 resources :users
76 match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership'
76 match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership'
77 match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete
77 match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete
78 match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships'
78 match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships'
79
79
80 match 'watchers/new', :controller=> 'watchers', :action => 'new', :via => :get
80 match 'watchers/new', :controller=> 'watchers', :action => 'new', :via => :get
81 match 'watchers', :controller=> 'watchers', :action => 'create', :via => :post
81 match 'watchers', :controller=> 'watchers', :action => 'create', :via => :post
82 match 'watchers/append', :controller=> 'watchers', :action => 'append', :via => :post
82 match 'watchers/append', :controller=> 'watchers', :action => 'append', :via => :post
83 match 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', :via => :post
83 match 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', :via => :post
84 match 'watchers/watch', :controller=> 'watchers', :action => 'watch', :via => :post
84 match 'watchers/watch', :controller=> 'watchers', :action => 'watch', :via => :post
85 match 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', :via => :post
85 match 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', :via => :post
86 match 'watchers/autocomplete_for_user', :controller=> 'watchers', :action => 'autocomplete_for_user', :via => :get
86 match 'watchers/autocomplete_for_user', :controller=> 'watchers', :action => 'autocomplete_for_user', :via => :get
87
87
88 resources :projects do
88 resources :projects do
89 member do
89 member do
90 get 'settings(/:tab)', :action => 'settings', :as => 'settings'
90 get 'settings(/:tab)', :action => 'settings', :as => 'settings'
91 post 'modules'
91 post 'modules'
92 post 'archive'
92 post 'archive'
93 post 'unarchive'
93 post 'unarchive'
94 post 'close'
94 post 'close'
95 post 'reopen'
95 post 'reopen'
96 match 'copy', :via => [:get, :post]
96 match 'copy', :via => [:get, :post]
97 end
97 end
98
98
99 resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
99 resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
100 collection do
100 collection do
101 get 'autocomplete'
101 get 'autocomplete'
102 end
102 end
103 end
103 end
104
104
105 resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy]
105 resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy]
106
106
107 get 'issues/:copy_from/copy', :to => 'issues#new', :as => 'copy_issue'
107 get 'issues/:copy_from/copy', :to => 'issues#new', :as => 'copy_issue'
108 resources :issues, :only => [:index, :new, :create] do
108 resources :issues, :only => [:index, :new, :create] do
109 resources :time_entries, :controller => 'timelog' do
109 resources :time_entries, :controller => 'timelog' do
110 collection do
110 collection do
111 get 'report'
111 get 'report'
112 end
112 end
113 end
113 end
114 end
114 end
115 # issue form update
115 # issue form update
116 match 'issues/new', :controller => 'issues', :action => 'new', :via => [:put, :post], :as => 'issue_form'
116 match 'issues/new', :controller => 'issues', :action => 'new', :via => [:put, :post], :as => 'issue_form'
117
117
118 resources :files, :only => [:index, :new, :create]
118 resources :files, :only => [:index, :new, :create]
119
119
120 resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
120 resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
121 collection do
121 collection do
122 put 'close_completed'
122 put 'close_completed'
123 end
123 end
124 end
124 end
125 get 'versions.:format', :to => 'versions#index'
125 get 'versions.:format', :to => 'versions#index'
126 get 'roadmap', :to => 'versions#index', :format => false
126 get 'roadmap', :to => 'versions#index', :format => false
127 get 'versions', :to => 'versions#index'
127 get 'versions', :to => 'versions#index'
128
128
129 resources :news, :except => [:show, :edit, :update, :destroy]
129 resources :news, :except => [:show, :edit, :update, :destroy]
130 resources :time_entries, :controller => 'timelog' do
130 resources :time_entries, :controller => 'timelog' do
131 get 'report', :on => :collection
131 get 'report', :on => :collection
132 end
132 end
133 resources :queries, :only => [:new, :create]
133 resources :queries, :only => [:new, :create]
134 resources :issue_categories, :shallow => true
134 resources :issue_categories, :shallow => true
135 resources :documents, :except => [:show, :edit, :update, :destroy]
135 resources :documents, :except => [:show, :edit, :update, :destroy]
136 resources :boards
136 resources :boards
137 resources :repositories, :shallow => true, :except => [:index, :show] do
137 resources :repositories, :shallow => true, :except => [:index, :show] do
138 member do
138 member do
139 match 'committers', :via => [:get, :post]
139 match 'committers', :via => [:get, :post]
140 end
140 end
141 end
141 end
142
142
143 match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
143 match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
144 resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do
144 resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do
145 member do
145 member do
146 get 'rename'
146 get 'rename'
147 post 'rename'
147 post 'rename'
148 get 'history'
148 get 'history'
149 get 'diff'
149 get 'diff'
150 match 'preview', :via => [:post, :put]
150 match 'preview', :via => [:post, :put]
151 post 'protect'
151 post 'protect'
152 post 'add_attachment'
152 post 'add_attachment'
153 end
153 end
154 collection do
154 collection do
155 get 'export'
155 get 'export'
156 get 'date_index'
156 get 'date_index'
157 end
157 end
158 end
158 end
159 match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
159 match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
160 get 'wiki/:id/:version', :to => 'wiki#show'
160 get 'wiki/:id/:version', :to => 'wiki#show'
161 delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
161 delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
162 get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
162 get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
163 get 'wiki/:id/:version/diff', :to => 'wiki#diff'
163 get 'wiki/:id/:version/diff', :to => 'wiki#diff'
164 end
164 end
165
165
166 resources :issues do
166 resources :issues do
167 collection do
167 collection do
168 match 'bulk_edit', :via => [:get, :post]
168 match 'bulk_edit', :via => [:get, :post]
169 post 'bulk_update'
169 post 'bulk_update'
170 end
170 end
171 resources :time_entries, :controller => 'timelog' do
171 resources :time_entries, :controller => 'timelog' do
172 collection do
172 collection do
173 get 'report'
173 get 'report'
174 end
174 end
175 end
175 end
176 resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
176 resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
177 end
177 end
178 match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete
178 match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete
179
179
180 resources :queries, :except => [:show]
180 resources :queries, :except => [:show]
181
181
182 resources :news, :only => [:index, :show, :edit, :update, :destroy]
182 resources :news, :only => [:index, :show, :edit, :update, :destroy]
183 match '/news/:id/comments', :to => 'comments#create', :via => :post
183 match '/news/:id/comments', :to => 'comments#create', :via => :post
184 match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
184 match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
185
185
186 resources :versions, :only => [:show, :edit, :update, :destroy] do
186 resources :versions, :only => [:show, :edit, :update, :destroy] do
187 post 'status_by', :on => :member
187 post 'status_by', :on => :member
188 end
188 end
189
189
190 resources :documents, :only => [:show, :edit, :update, :destroy] do
190 resources :documents, :only => [:show, :edit, :update, :destroy] do
191 post 'add_attachment', :on => :member
191 post 'add_attachment', :on => :member
192 end
192 end
193
193
194 match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu, :via => [:get, :post]
194 match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu, :via => [:get, :post]
195
195
196 resources :time_entries, :controller => 'timelog', :except => :destroy do
196 resources :time_entries, :controller => 'timelog', :except => :destroy do
197 collection do
197 collection do
198 get 'report'
198 get 'report'
199 get 'bulk_edit'
199 get 'bulk_edit'
200 post 'bulk_update'
200 post 'bulk_update'
201 end
201 end
202 end
202 end
203 match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/
203 match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/
204 # TODO: delete /time_entries for bulk deletion
204 # TODO: delete /time_entries for bulk deletion
205 match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete
205 match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete
206
206
207 get 'projects/:id/activity', :to => 'activities#index'
207 get 'projects/:id/activity', :to => 'activities#index'
208 get 'projects/:id/activity.:format', :to => 'activities#index'
208 get 'projects/:id/activity.:format', :to => 'activities#index'
209 get 'activity', :to => 'activities#index'
209 get 'activity', :to => 'activities#index'
210
210
211 # repositories routes
211 # repositories routes
212 get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
212 get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
213 get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
213 get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
214
214
215 get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))',
215 get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))',
216 :to => 'repositories#changes'
216 :to => 'repositories#changes'
217
217
218 get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
218 get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
219 get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
219 get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
220 post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
220 post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
221 delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
221 delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
222 get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
222 get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
223 get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))',
223 get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))',
224 :controller => 'repositories',
224 :controller => 'repositories',
225 :format => false,
225 :format => false,
226 :constraints => {
226 :constraints => {
227 :action => /(browse|show|entry|raw|annotate|diff)/,
227 :action => /(browse|show|entry|raw|annotate|diff)/,
228 :rev => /[a-z0-9\.\-_]+/
228 :rev => /[a-z0-9\.\-_]+/
229 }
229 }
230
230
231 get 'projects/:id/repository/statistics', :to => 'repositories#stats'
231 get 'projects/:id/repository/statistics', :to => 'repositories#stats'
232 get 'projects/:id/repository/graph', :to => 'repositories#graph'
232 get 'projects/:id/repository/graph', :to => 'repositories#graph'
233
233
234 get 'projects/:id/repository/changes(/*path(.:ext))',
234 get 'projects/:id/repository/changes(/*path(.:ext))',
235 :to => 'repositories#changes'
235 :to => 'repositories#changes'
236
236
237 get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
237 get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
238 get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
238 get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
239 get 'projects/:id/repository/revision', :to => 'repositories#revision'
239 get 'projects/:id/repository/revision', :to => 'repositories#revision'
240 post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue'
240 post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue'
241 delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
241 delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
242 get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))',
242 get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))',
243 :controller => 'repositories',
243 :controller => 'repositories',
244 :format => false,
244 :format => false,
245 :constraints => {
245 :constraints => {
246 :action => /(browse|show|entry|raw|annotate|diff)/,
246 :action => /(browse|show|entry|raw|annotate|diff)/,
247 :rev => /[a-z0-9\.\-_]+/
247 :rev => /[a-z0-9\.\-_]+/
248 }
248 }
249 get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))',
249 get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))',
250 :controller => 'repositories',
250 :controller => 'repositories',
251 :action => /(browse|show|entry|raw|changes|annotate|diff)/
251 :action => /(browse|show|entry|raw|changes|annotate|diff)/
252 get 'projects/:id/repository/:action(/*path(.:ext))',
252 get 'projects/:id/repository/:action(/*path(.:ext))',
253 :controller => 'repositories',
253 :controller => 'repositories',
254 :action => /(browse|show|entry|raw|changes|annotate|diff)/
254 :action => /(browse|show|entry|raw|changes|annotate|diff)/
255
255
256 get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
256 get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
257 get 'projects/:id/repository', :to => 'repositories#show', :path => nil
257 get 'projects/:id/repository', :to => 'repositories#show', :path => nil
258
258
259 # additional routes for having the file name at the end of url
259 # additional routes for having the file name at the end of url
260 match 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/, :via => :get
260 match 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/, :via => :get
261 match 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/, :via => :get
261 match 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/, :via => :get
262 match 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/, :via => :get
262 match 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/, :via => :get
263 match 'attachments/thumbnail/:id(/:size)', :controller => 'attachments', :action => 'thumbnail', :id => /\d+/, :via => :get, :size => /\d+/
263 match 'attachments/thumbnail/:id(/:size)', :controller => 'attachments', :action => 'thumbnail', :id => /\d+/, :via => :get, :size => /\d+/
264 resources :attachments, :only => [:show, :destroy]
264 resources :attachments, :only => [:show, :destroy]
265
265
266 resources :groups do
266 resources :groups do
267 member do
267 member do
268 get 'autocomplete_for_user'
268 get 'autocomplete_for_user'
269 end
269 end
270 end
270 end
271
271
272 match 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :via => :post, :as => 'group_users'
272 match 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :via => :post, :as => 'group_users'
273 match 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :via => :delete, :as => 'group_user'
273 match 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :via => :delete, :as => 'group_user'
274 match 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :via => :post
274 match 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :via => :post
275 match 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :via => :post
275 match 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :via => :post
276
276
277 resources :trackers, :except => :show do
277 resources :trackers, :except => :show do
278 collection do
278 collection do
279 match 'fields', :via => [:get, :post]
279 match 'fields', :via => [:get, :post]
280 end
280 end
281 end
281 end
282 resources :issue_statuses, :except => :show do
282 resources :issue_statuses, :except => :show do
283 collection do
283 collection do
284 post 'update_issue_done_ratio'
284 post 'update_issue_done_ratio'
285 end
285 end
286 end
286 end
287 resources :custom_fields, :except => :show
287 resources :custom_fields, :except => :show
288 resources :roles do
288 resources :roles do
289 collection do
289 collection do
290 match 'permissions', :via => [:get, :post]
290 match 'permissions', :via => [:get, :post]
291 end
291 end
292 end
292 end
293 resources :enumerations, :except => :show
293 resources :enumerations, :except => :show
294 match 'enumerations/:type', :to => 'enumerations#index', :via => :get
294 match 'enumerations/:type', :to => 'enumerations#index', :via => :get
295
295
296 get 'projects/:id/search', :controller => 'search', :action => 'index'
296 get 'projects/:id/search', :controller => 'search', :action => 'index'
297 get 'search', :controller => 'search', :action => 'index'
297 get 'search', :controller => 'search', :action => 'index'
298
298
299 match 'mail_handler', :controller => 'mail_handler', :action => 'index', :via => :post
299 match 'mail_handler', :controller => 'mail_handler', :action => 'index', :via => :post
300
300
301 match 'admin', :controller => 'admin', :action => 'index', :via => :get
301 match 'admin', :controller => 'admin', :action => 'index', :via => :get
302 match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
302 match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
303 match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
303 match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
304 match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
304 match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
305 match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get
305 match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get
306 match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post
306 match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post
307
307
308 resources :auth_sources do
308 resources :auth_sources do
309 member do
309 member do
310 get 'test_connection', :as => 'try_connection'
310 get 'test_connection', :as => 'try_connection'
311 end
311 end
312 end
312 end
313
313
314 match 'workflows', :controller => 'workflows', :action => 'index', :via => :get
314 match 'workflows', :controller => 'workflows', :action => 'index', :via => :get
315 match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post]
315 match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post]
316 match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post]
316 match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post]
317 match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post]
317 match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post]
318 match 'settings', :controller => 'settings', :action => 'index', :via => :get
318 match 'settings', :controller => 'settings', :action => 'index', :via => :get
319 match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post]
319 match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post]
320 match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post], :as => 'plugin_settings'
320 match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post], :as => 'plugin_settings'
321
321
322 match 'sys/projects', :to => 'sys#projects', :via => :get
322 match 'sys/projects', :to => 'sys#projects', :via => :get
323 match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
323 match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
324 match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => :get
324 match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => :get
325
325
326 match 'uploads', :to => 'attachments#upload', :via => :post
326 match 'uploads', :to => 'attachments#upload', :via => :post
327
327
328 get 'robots.txt', :to => 'welcome#robots'
328 get 'robots.txt', :to => 'welcome#robots'
329
329
330 Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
330 Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
331 file = File.join(plugin_dir, "config/routes.rb")
331 file = File.join(plugin_dir, "config/routes.rb")
332 if File.exists?(file)
332 if File.exists?(file)
333 begin
333 begin
334 instance_eval File.read(file)
334 instance_eval File.read(file)
335 rescue Exception => e
335 rescue Exception => e
336 puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}."
336 puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}."
337 exit 1
337 exit 1
338 end
338 end
339 end
339 end
340 end
340 end
341 end
341 end
General Comments 0
You need to be logged in to leave comments. Login now