##// END OF EJS Templates
Fixing calendar and gantt links broken by r2317....
Jean-Philippe Lang -
r2326:c4af6efd2556
parent child
Show More
@@ -1,55 +1,55
1 <% form_tag({}, :id => 'query_form') do %>
1 <% form_tag({}, :id => 'query_form') do %>
2 <% if @query.new_record? %>
2 <% if @query.new_record? %>
3 <h2><%= l(:label_calendar) %></h2>
3 <h2><%= l(:label_calendar) %></h2>
4 <fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend>
4 <fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend>
5 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
5 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
6 </fieldset>
6 </fieldset>
7 <% else %>
7 <% else %>
8 <h2><%=h @query.name %></h2>
8 <h2><%=h @query.name %></h2>
9 <% html_title @query.name %>
9 <% html_title @query.name %>
10 <% end %>
10 <% end %>
11
11
12 <fieldset id="date-range"><legend><%= l(:label_date_range) %></legend>
12 <fieldset id="date-range"><legend><%= l(:label_date_range) %></legend>
13 <%= select_month(@month, :prefix => "month", :discard_type => true) %>
13 <%= select_month(@month, :prefix => "month", :discard_type => true) %>
14 <%= select_year(@year, :prefix => "year", :discard_type => true) %>
14 <%= select_year(@year, :prefix => "year", :discard_type => true) %>
15 </fieldset>
15 </fieldset>
16
16
17 <p style="float:right; margin:0px;">
17 <p style="float:right; margin:0px;">
18 <%= link_to_remote ('&#171; ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
18 <%= link_to_remote ('&#171; ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
19 {:update => "content", :url => { :project_id => @project, :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }},
19 {:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }},
20 {:href => url_for(:action => 'calendar', :project_id => @project, :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))}
20 {:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))}
21 %> |
21 %> |
22 <%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' &#187;'),
22 <%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' &#187;'),
23 {:update => "content", :url => { :project_id => @project, :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }},
23 {:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }},
24 {:href => url_for(:action => 'calendar', :project_id => @project, :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))}
24 {:href => url_for(:action => 'calendar', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))}
25 %>
25 %>
26 </p>
26 </p>
27
27
28 <p class="buttons">
28 <p class="buttons">
29 <%= link_to_remote l(:button_apply),
29 <%= link_to_remote l(:button_apply),
30 { :url => { :project_id => @project, :set_filter => (@query.new_record? ? 1 : nil) },
30 { :url => { :set_filter => (@query.new_record? ? 1 : nil) },
31 :update => "content",
31 :update => "content",
32 :with => "Form.serialize('query_form')"
32 :with => "Form.serialize('query_form')"
33 }, :class => 'icon icon-checked' %>
33 }, :class => 'icon icon-checked' %>
34
34
35 <%= link_to_remote l(:button_clear),
35 <%= link_to_remote l(:button_clear),
36 { :url => { :project_id => @project, :set_filter => (@query.new_record? ? 1 : nil) },
36 { :url => { :set_filter => (@query.new_record? ? 1 : nil) },
37 :update => "content",
37 :update => "content",
38 }, :class => 'icon icon-reload' if @query.new_record? %>
38 }, :class => 'icon icon-reload' if @query.new_record? %>
39 </p>
39 </p>
40 <% end %>
40 <% end %>
41
41
42 <%= error_messages_for 'query' %>
42 <%= error_messages_for 'query' %>
43 <% if @query.valid? %>
43 <% if @query.valid? %>
44 <%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %>
44 <%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %>
45
45
46 <%= image_tag 'arrow_from.png' %>&nbsp;&nbsp;<%= l(:text_tip_task_begin_day) %><br />
46 <%= image_tag 'arrow_from.png' %>&nbsp;&nbsp;<%= l(:text_tip_task_begin_day) %><br />
47 <%= image_tag 'arrow_to.png' %>&nbsp;&nbsp;<%= l(:text_tip_task_end_day) %><br />
47 <%= image_tag 'arrow_to.png' %>&nbsp;&nbsp;<%= l(:text_tip_task_end_day) %><br />
48 <%= image_tag 'arrow_bw.png' %>&nbsp;&nbsp;<%= l(:text_tip_task_begin_end_day) %><br />
48 <%= image_tag 'arrow_bw.png' %>&nbsp;&nbsp;<%= l(:text_tip_task_begin_end_day) %><br />
49 <% end %>
49 <% end %>
50
50
51 <% content_for :sidebar do %>
51 <% content_for :sidebar do %>
52 <%= render :partial => 'issues/sidebar' %>
52 <%= render :partial => 'issues/sidebar' %>
53 <% end %>
53 <% end %>
54
54
55 <% html_title(l(:label_calendar)) -%>
55 <% html_title(l(:label_calendar)) -%>
@@ -1,254 +1,256
1 ActionController::Routing::Routes.draw do |map|
1 ActionController::Routing::Routes.draw do |map|
2 # Add your own custom routes here.
2 # Add your own custom routes here.
3 # The priority is based upon order of creation: first created -> highest priority.
3 # The priority is based upon order of creation: first created -> highest priority.
4
4
5 # Here's a sample route:
5 # Here's a sample route:
6 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
6 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
7 # Keep in mind you can assign values other than :controller and :action
7 # Keep in mind you can assign values other than :controller and :action
8
8
9 # Allow Redmine plugins to map routes and potentially override them
9 # Allow Redmine plugins to map routes and potentially override them
10 Rails.plugins.each do |plugin|
10 Rails.plugins.each do |plugin|
11 map.from_plugin plugin.name.to_sym
11 map.from_plugin plugin.name.to_sym
12 end
12 end
13
13
14 map.home '', :controller => 'welcome'
14 map.home '', :controller => 'welcome'
15
15
16 map.signin 'login', :controller => 'account', :action => 'login'
16 map.signin 'login', :controller => 'account', :action => 'login'
17 map.signout 'logout', :controller => 'account', :action => 'logout'
17 map.signout 'logout', :controller => 'account', :action => 'logout'
18
18
19 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
19 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
20 map.connect 'help/:ctrl/:page', :controller => 'help'
20 map.connect 'help/:ctrl/:page', :controller => 'help'
21
21
22 map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog'
22 map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog'
23 map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog'
23 map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog'
24 map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog'
24 map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog'
25
25
26 map.with_options :controller => 'timelog' do |timelog|
26 map.with_options :controller => 'timelog' do |timelog|
27 timelog.connect 'projects/:project_id/time_entries', :action => 'details'
27 timelog.connect 'projects/:project_id/time_entries', :action => 'details'
28
28
29 timelog.with_options :action => 'details', :conditions => {:method => :get} do |time_details|
29 timelog.with_options :action => 'details', :conditions => {:method => :get} do |time_details|
30 time_details.connect 'time_entries'
30 time_details.connect 'time_entries'
31 time_details.connect 'time_entries.:format'
31 time_details.connect 'time_entries.:format'
32 time_details.connect 'issues/:issue_id/time_entries'
32 time_details.connect 'issues/:issue_id/time_entries'
33 time_details.connect 'issues/:issue_id/time_entries.:format'
33 time_details.connect 'issues/:issue_id/time_entries.:format'
34 time_details.connect 'projects/:project_id/time_entries.:format'
34 time_details.connect 'projects/:project_id/time_entries.:format'
35 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries'
35 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries'
36 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries.:format'
36 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries.:format'
37 end
37 end
38 timelog.connect 'projects/:project_id/time_entries/report', :action => 'report'
38 timelog.connect 'projects/:project_id/time_entries/report', :action => 'report'
39 timelog.with_options :action => 'report',:conditions => {:method => :get} do |time_report|
39 timelog.with_options :action => 'report',:conditions => {:method => :get} do |time_report|
40 time_report.connect 'time_entries/report'
40 time_report.connect 'time_entries/report'
41 time_report.connect 'time_entries/report.:format'
41 time_report.connect 'time_entries/report.:format'
42 time_report.connect 'projects/:project_id/time_entries/report.:format'
42 time_report.connect 'projects/:project_id/time_entries/report.:format'
43 end
43 end
44
44
45 timelog.with_options :action => 'edit', :conditions => {:method => :get} do |time_edit|
45 timelog.with_options :action => 'edit', :conditions => {:method => :get} do |time_edit|
46 time_edit.connect 'issues/:issue_id/time_entries/new'
46 time_edit.connect 'issues/:issue_id/time_entries/new'
47 end
47 end
48
48
49 timelog.connect 'time_entries/:id/destroy', :action => 'destroy', :conditions => {:method => :post}
49 timelog.connect 'time_entries/:id/destroy', :action => 'destroy', :conditions => {:method => :post}
50 end
50 end
51
51
52 map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post}
52 map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post}
53 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get}
53 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get}
54 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post}
54 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post}
55 map.with_options :controller => 'wiki' do |wiki_routes|
55 map.with_options :controller => 'wiki' do |wiki_routes|
56 wiki_routes.with_options :conditions => {:method => :get} do |wiki_views|
56 wiki_routes.with_options :conditions => {:method => :get} do |wiki_views|
57 wiki_views.connect 'projects/:id/wiki/:page', :action => 'special', :page => /page_index|date_index|export/i
57 wiki_views.connect 'projects/:id/wiki/:page', :action => 'special', :page => /page_index|date_index|export/i
58 wiki_views.connect 'projects/:id/wiki/:page', :action => 'index', :page => nil
58 wiki_views.connect 'projects/:id/wiki/:page', :action => 'index', :page => nil
59 wiki_views.connect 'projects/:id/wiki/:page/edit', :action => 'edit'
59 wiki_views.connect 'projects/:id/wiki/:page/edit', :action => 'edit'
60 wiki_views.connect 'projects/:id/wiki/:page/rename', :action => 'rename'
60 wiki_views.connect 'projects/:id/wiki/:page/rename', :action => 'rename'
61 wiki_views.connect 'projects/:id/wiki/:page/history', :action => 'history'
61 wiki_views.connect 'projects/:id/wiki/:page/history', :action => 'history'
62 wiki_views.connect 'projects/:id/wiki/:page/diff/:version/vs/:version_from', :action => 'diff'
62 wiki_views.connect 'projects/:id/wiki/:page/diff/:version/vs/:version_from', :action => 'diff'
63 wiki_views.connect 'projects/:id/wiki/:page/annotate/:version', :action => 'annotate'
63 wiki_views.connect 'projects/:id/wiki/:page/annotate/:version', :action => 'annotate'
64 end
64 end
65
65
66 wiki_routes.connect 'projects/:id/wiki/:page/:action',
66 wiki_routes.connect 'projects/:id/wiki/:page/:action',
67 :action => /edit|rename|destroy|preview|protect/,
67 :action => /edit|rename|destroy|preview|protect/,
68 :conditions => {:method => :post}
68 :conditions => {:method => :post}
69 end
69 end
70
70
71 map.with_options :controller => 'messages' do |messages_routes|
71 map.with_options :controller => 'messages' do |messages_routes|
72 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
72 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
73 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
73 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
74 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
74 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
75 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
75 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
76 end
76 end
77 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
77 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
78 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
78 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
79 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
79 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
80 messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/
80 messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/
81 end
81 end
82 end
82 end
83
83
84 map.with_options :controller => 'boards' do |board_routes|
84 map.with_options :controller => 'boards' do |board_routes|
85 board_routes.with_options :conditions => {:method => :get} do |board_views|
85 board_routes.with_options :conditions => {:method => :get} do |board_views|
86 board_views.connect 'projects/:project_id/boards', :action => 'index'
86 board_views.connect 'projects/:project_id/boards', :action => 'index'
87 board_views.connect 'projects/:project_id/boards/new', :action => 'new'
87 board_views.connect 'projects/:project_id/boards/new', :action => 'new'
88 board_views.connect 'projects/:project_id/boards/:id', :action => 'show'
88 board_views.connect 'projects/:project_id/boards/:id', :action => 'show'
89 board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit'
89 board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit'
90 end
90 end
91 board_routes.with_options :conditions => {:method => :post} do |board_actions|
91 board_routes.with_options :conditions => {:method => :post} do |board_actions|
92 board_actions.connect 'projects/:project_id/boards', :action => 'new'
92 board_actions.connect 'projects/:project_id/boards', :action => 'new'
93 board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/
93 board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/
94 end
94 end
95 end
95 end
96
96
97 map.with_options :controller => 'documents' do |document_routes|
97 map.with_options :controller => 'documents' do |document_routes|
98 document_routes.with_options :conditions => {:method => :get} do |document_views|
98 document_routes.with_options :conditions => {:method => :get} do |document_views|
99 document_views.connect 'projects/:project_id/documents', :action => 'index'
99 document_views.connect 'projects/:project_id/documents', :action => 'index'
100 document_views.connect 'projects/:project_id/documents/new', :action => 'new'
100 document_views.connect 'projects/:project_id/documents/new', :action => 'new'
101 document_views.connect 'documents/:id', :action => 'show'
101 document_views.connect 'documents/:id', :action => 'show'
102 document_views.connect 'documents/:id/edit', :action => 'edit'
102 document_views.connect 'documents/:id/edit', :action => 'edit'
103 end
103 end
104 document_routes.with_options :conditions => {:method => :post} do |document_actions|
104 document_routes.with_options :conditions => {:method => :post} do |document_actions|
105 document_actions.connect 'projects/:project_id/documents', :action => 'new'
105 document_actions.connect 'projects/:project_id/documents', :action => 'new'
106 document_actions.connect 'documents/:id/:action', :action => /destroy|edit/
106 document_actions.connect 'documents/:id/:action', :action => /destroy|edit/
107 end
107 end
108 end
108 end
109
109
110 map.with_options :controller => 'issues' do |issues_routes|
110 map.with_options :controller => 'issues' do |issues_routes|
111 issues_routes.with_options :conditions => {:method => :get} do |issues_views|
111 issues_routes.with_options :conditions => {:method => :get} do |issues_views|
112 issues_views.connect 'issues', :action => 'index'
112 issues_views.connect 'issues', :action => 'index'
113 issues_views.connect 'issues.:format', :action => 'index'
113 issues_views.connect 'issues.:format', :action => 'index'
114 issues_views.connect 'projects/:project_id/issues.:format', :action => 'index'
114 issues_views.connect 'projects/:project_id/issues.:format', :action => 'index'
115 issues_views.connect 'projects/:project_id/issues/new', :action => 'new'
115 issues_views.connect 'projects/:project_id/issues/new', :action => 'new'
116 issues_views.connect 'projects/:project_id/issues/gantt', :action => 'gantt'
117 issues_views.connect 'projects/:project_id/issues/calendar', :action => 'calendar'
116 issues_views.connect 'projects/:project_id/issues/:copy_from/copy', :action => 'new'
118 issues_views.connect 'projects/:project_id/issues/:copy_from/copy', :action => 'new'
117 issues_views.connect 'issues/:id', :action => 'show', :id => /\d+/
119 issues_views.connect 'issues/:id', :action => 'show', :id => /\d+/
118 issues_views.connect 'issues/:id.:format', :action => 'show', :id => /\d+/
120 issues_views.connect 'issues/:id.:format', :action => 'show', :id => /\d+/
119 issues_views.connect 'issues/:id/edit', :action => 'edit', :id => /\d+/
121 issues_views.connect 'issues/:id/edit', :action => 'edit', :id => /\d+/
120 issues_views.connect 'issues/:id/move', :action => 'move', :id => /\d+/
122 issues_views.connect 'issues/:id/move', :action => 'move', :id => /\d+/
121 end
123 end
122 issues_routes.with_options :conditions => {:method => :post} do |issues_actions|
124 issues_routes.with_options :conditions => {:method => :post} do |issues_actions|
123 issues_actions.connect 'projects/:project_id/issues', :action => 'new'
125 issues_actions.connect 'projects/:project_id/issues', :action => 'new'
124 issues_actions.connect 'issues/:id/quoted', :action => 'reply', :id => /\d+/
126 issues_actions.connect 'issues/:id/quoted', :action => 'reply', :id => /\d+/
125 issues_actions.connect 'issues/:id/:action', :action => /edit|move|destroy/, :id => /\d+/
127 issues_actions.connect 'issues/:id/:action', :action => /edit|move|destroy/, :id => /\d+/
126 end
128 end
127 issues_routes.connect 'issues/:action'
129 issues_routes.connect 'issues/:action'
128 end
130 end
129
131
130 map.with_options :controller => 'issue_relations', :conditions => {:method => :post} do |relations|
132 map.with_options :controller => 'issue_relations', :conditions => {:method => :post} do |relations|
131 relations.connect 'issues/:issue_id/relations/:id', :action => 'new'
133 relations.connect 'issues/:issue_id/relations/:id', :action => 'new'
132 relations.connect 'issues/:issue_id/relations/:id/destroy', :action => 'destroy'
134 relations.connect 'issues/:issue_id/relations/:id/destroy', :action => 'destroy'
133 end
135 end
134
136
135 map.with_options :controller => 'reports', :action => 'issue_report', :conditions => {:method => :get} do |reports|
137 map.with_options :controller => 'reports', :action => 'issue_report', :conditions => {:method => :get} do |reports|
136 reports.connect 'projects/:id/issues/report'
138 reports.connect 'projects/:id/issues/report'
137 reports.connect 'projects/:id/issues/report/:detail'
139 reports.connect 'projects/:id/issues/report/:detail'
138 end
140 end
139
141
140 map.with_options :controller => 'news' do |news_routes|
142 map.with_options :controller => 'news' do |news_routes|
141 news_routes.with_options :conditions => {:method => :get} do |news_views|
143 news_routes.with_options :conditions => {:method => :get} do |news_views|
142 news_views.connect 'news', :action => 'index'
144 news_views.connect 'news', :action => 'index'
143 news_views.connect 'projects/:project_id/news', :action => 'index'
145 news_views.connect 'projects/:project_id/news', :action => 'index'
144 news_views.connect 'projects/:project_id/news.:format', :action => 'index'
146 news_views.connect 'projects/:project_id/news.:format', :action => 'index'
145 news_views.connect 'news.:format', :action => 'index'
147 news_views.connect 'news.:format', :action => 'index'
146 news_views.connect 'projects/:project_id/news/new', :action => 'new'
148 news_views.connect 'projects/:project_id/news/new', :action => 'new'
147 news_views.connect 'news/:id', :action => 'show'
149 news_views.connect 'news/:id', :action => 'show'
148 news_views.connect 'news/:id/edit', :action => 'edit'
150 news_views.connect 'news/:id/edit', :action => 'edit'
149 end
151 end
150 news_routes.with_options do |news_actions|
152 news_routes.with_options do |news_actions|
151 news_actions.connect 'projects/:project_id/news', :action => 'new'
153 news_actions.connect 'projects/:project_id/news', :action => 'new'
152 news_actions.connect 'news/:id/edit', :action => 'edit'
154 news_actions.connect 'news/:id/edit', :action => 'edit'
153 news_actions.connect 'news/:id/destroy', :action => 'destroy'
155 news_actions.connect 'news/:id/destroy', :action => 'destroy'
154 end
156 end
155 end
157 end
156
158
157 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new'
159 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new'
158
160
159 map.with_options :controller => 'users' do |users|
161 map.with_options :controller => 'users' do |users|
160 users.with_options :conditions => {:method => :get} do |user_views|
162 users.with_options :conditions => {:method => :get} do |user_views|
161 user_views.connect 'users', :action => 'list'
163 user_views.connect 'users', :action => 'list'
162 user_views.connect 'users', :action => 'index'
164 user_views.connect 'users', :action => 'index'
163 user_views.connect 'users/new', :action => 'add'
165 user_views.connect 'users/new', :action => 'add'
164 user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil
166 user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil
165 end
167 end
166 users.with_options :conditions => {:method => :post} do |user_actions|
168 users.with_options :conditions => {:method => :post} do |user_actions|
167 user_actions.connect 'users', :action => 'add'
169 user_actions.connect 'users', :action => 'add'
168 user_actions.connect 'users/new', :action => 'add'
170 user_actions.connect 'users/new', :action => 'add'
169 user_actions.connect 'users/:id/edit', :action => 'edit'
171 user_actions.connect 'users/:id/edit', :action => 'edit'
170 user_actions.connect 'users/:id/memberships', :action => 'edit_membership'
172 user_actions.connect 'users/:id/memberships', :action => 'edit_membership'
171 user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership'
173 user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership'
172 user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership'
174 user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership'
173 end
175 end
174 end
176 end
175
177
176 map.with_options :controller => 'projects' do |projects|
178 map.with_options :controller => 'projects' do |projects|
177 projects.with_options :conditions => {:method => :get} do |project_views|
179 projects.with_options :conditions => {:method => :get} do |project_views|
178 project_views.connect 'projects', :action => 'index'
180 project_views.connect 'projects', :action => 'index'
179 project_views.connect 'projects.:format', :action => 'index'
181 project_views.connect 'projects.:format', :action => 'index'
180 project_views.connect 'projects/new', :action => 'add'
182 project_views.connect 'projects/new', :action => 'add'
181 project_views.connect 'projects/:id', :action => 'show'
183 project_views.connect 'projects/:id', :action => 'show'
182 project_views.connect 'projects/:id/:action', :action => /roadmap|changelog|destroy|settings/
184 project_views.connect 'projects/:id/:action', :action => /roadmap|changelog|destroy|settings/
183 project_views.connect 'projects/:id/files', :action => 'list_files'
185 project_views.connect 'projects/:id/files', :action => 'list_files'
184 project_views.connect 'projects/:id/files/new', :action => 'add_file'
186 project_views.connect 'projects/:id/files/new', :action => 'add_file'
185 project_views.connect 'projects/:id/versions/new', :action => 'add_version'
187 project_views.connect 'projects/:id/versions/new', :action => 'add_version'
186 project_views.connect 'projects/:id/categories/new', :action => 'add_issue_category'
188 project_views.connect 'projects/:id/categories/new', :action => 'add_issue_category'
187 project_views.connect 'projects/:id/settings/:tab', :action => 'settings'
189 project_views.connect 'projects/:id/settings/:tab', :action => 'settings'
188 end
190 end
189
191
190 projects.with_options :action => 'activity', :conditions => {:method => :get} do |activity|
192 projects.with_options :action => 'activity', :conditions => {:method => :get} do |activity|
191 activity.connect 'projects/:id/activity'
193 activity.connect 'projects/:id/activity'
192 activity.connect 'projects/:id/activity.:format'
194 activity.connect 'projects/:id/activity.:format'
193 activity.connect 'activity'
195 activity.connect 'activity'
194 activity.connect 'activity.:format'
196 activity.connect 'activity.:format'
195 end
197 end
196
198
197 projects.with_options :conditions => {:method => :post} do |project_actions|
199 projects.with_options :conditions => {:method => :post} do |project_actions|
198 project_actions.connect 'projects/new', :action => 'add'
200 project_actions.connect 'projects/new', :action => 'add'
199 project_actions.connect 'projects', :action => 'add'
201 project_actions.connect 'projects', :action => 'add'
200 project_actions.connect 'projects/:id/:action', :action => /destroy|archive|unarchive/
202 project_actions.connect 'projects/:id/:action', :action => /destroy|archive|unarchive/
201 project_actions.connect 'projects/:id/files/new', :action => 'add_file'
203 project_actions.connect 'projects/:id/files/new', :action => 'add_file'
202 project_actions.connect 'projects/:id/versions/new', :action => 'add_version'
204 project_actions.connect 'projects/:id/versions/new', :action => 'add_version'
203 project_actions.connect 'projects/:id/categories/new', :action => 'add_issue_category'
205 project_actions.connect 'projects/:id/categories/new', :action => 'add_issue_category'
204 end
206 end
205 end
207 end
206
208
207 map.with_options :controller => 'repositories' do |repositories|
209 map.with_options :controller => 'repositories' do |repositories|
208 repositories.with_options :conditions => {:method => :get} do |repository_views|
210 repositories.with_options :conditions => {:method => :get} do |repository_views|
209 repositories.connect 'projects/:id/repository', :action => 'show'
211 repositories.connect 'projects/:id/repository', :action => 'show'
210 repositories.connect 'projects/:id/repository/edit', :action => 'edit'
212 repositories.connect 'projects/:id/repository/edit', :action => 'edit'
211 repositories.connect 'projects/:id/repository/statistics', :action => 'stats'
213 repositories.connect 'projects/:id/repository/statistics', :action => 'stats'
212 repositories.connect 'projects/:id/repository/revisions', :action => 'revisions'
214 repositories.connect 'projects/:id/repository/revisions', :action => 'revisions'
213 repositories.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
215 repositories.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
214 repositories.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
216 repositories.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
215 repositories.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
217 repositories.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
216 repositories.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
218 repositories.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
217 repositories.connect 'projects/:id/repository/revisions/:rev/:action/*path'
219 repositories.connect 'projects/:id/repository/revisions/:rev/:action/*path'
218 repositories.connect 'projects/:id/repository/:action/*path'
220 repositories.connect 'projects/:id/repository/:action/*path'
219 end
221 end
220
222
221 repositories.connect 'projects/:id/repository/edit', :action => 'edit', :conditions => {:method => :post}
223 repositories.connect 'projects/:id/repository/edit', :action => 'edit', :conditions => {:method => :post}
222 end
224 end
223
225
224 map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/
226 map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/
225 map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
227 map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
226 map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
228 map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
227
229
228
230
229 #left old routes at the bottom for backwards compat
231 #left old routes at the bottom for backwards compat
230 map.connect 'projects/:project_id/issues/:action', :controller => 'issues'
232 map.connect 'projects/:project_id/issues/:action', :controller => 'issues'
231 map.connect 'projects/:project_id/documents/:action', :controller => 'documents'
233 map.connect 'projects/:project_id/documents/:action', :controller => 'documents'
232 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards'
234 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards'
233 map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages'
235 map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages'
234 map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki'
236 map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki'
235 map.connect 'issues/:issue_id/relations/:action/:id', :controller => 'issue_relations'
237 map.connect 'issues/:issue_id/relations/:action/:id', :controller => 'issue_relations'
236 map.connect 'projects/:project_id/news/:action', :controller => 'news'
238 map.connect 'projects/:project_id/news/:action', :controller => 'news'
237 map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/
239 map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/
238 map.with_options :controller => 'repositories' do |omap|
240 map.with_options :controller => 'repositories' do |omap|
239 omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse'
241 omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse'
240 omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes'
242 omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes'
241 omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff'
243 omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff'
242 omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry'
244 omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry'
243 omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate'
245 omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate'
244 omap.connect 'repositories/revision/:id/:rev', :action => 'revision'
246 omap.connect 'repositories/revision/:id/:rev', :action => 'revision'
245 end
247 end
246
248
247 # Allow downloading Web Service WSDL as a file with an extension
249 # Allow downloading Web Service WSDL as a file with an extension
248 # instead of a file named 'wsdl'
250 # instead of a file named 'wsdl'
249 map.connect ':controller/service.wsdl', :action => 'wsdl'
251 map.connect ':controller/service.wsdl', :action => 'wsdl'
250
252
251 # Install the default route as the lowest priority.
253 # Install the default route as the lowest priority.
252 map.connect ':controller/:action/:id'
254 map.connect ':controller/:action/:id'
253 map.connect 'robots.txt', :controller => 'welcome', :action => 'robots'
255 map.connect 'robots.txt', :controller => 'welcome', :action => 'robots'
254 end
256 end
General Comments 0
You need to be logged in to leave comments. Login now