diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-23 15:12:57 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-23 15:12:57 +0000 |
commit | 1528c719a425851dd8576773e30b4b64b9d4736e (patch) | |
tree | 6c59fa7106a6d72487b64bb160193122b0202f88 | |
parent | 0927230a18de0183fac95625071357d748496c9f (diff) | |
download | redmine-1528c719a425851dd8576773e30b4b64b9d4736e.tar.gz redmine-1528c719a425851dd8576773e30b4b64b9d4736e.zip |
Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11074 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/views/projects/show.html.erb | 16 | ||||
-rw-r--r-- | config/routes.rb | 4 |
2 files changed, 9 insertions, 11 deletions
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 3317594ae..8452a02d2 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -1,6 +1,6 @@ <div class="contextual"> <% if User.current.allowed_to?(:add_subprojects, @project) %> - <%= link_to l(:label_subproject_new), {:controller => 'projects', :action => 'new', :parent_id => @project}, :class => 'icon icon-add' %> + <%= link_to l(:label_subproject_new), new_project_path(:parent_id => @project), :class => 'icon icon-add' %> <% end %> <% if User.current.allowed_to?(:close_project, @project) %> <% if @project.active? %> @@ -29,7 +29,7 @@ <% end %> <% if @subprojects.any? %> <li><%=l(:label_subproject_plural)%>: - <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ").html_safe %></li> + <%= @subprojects.collect{|p| link_to p, project_path(p)}.join(", ").html_safe %></li> <% end %> <% @project.visible_custom_field_values.each do |custom_value| %> <% if !custom_value.value.blank? %> @@ -43,21 +43,19 @@ <h3><%=l(:label_issue_tracking)%></h3> <ul> <% for tracker in @trackers %> - <li><%= link_to h(tracker.name), :controller => 'issues', :action => 'index', :project_id => @project, - :set_filter => 1, - "tracker_id" => tracker.id %>: + <li><%= link_to h(tracker.name), project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id) %>: <%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i, :total => @total_issues_by_tracker[tracker].to_i) %> </li> <% end %> </ul> <p> - <%= link_to l(:label_issue_view_all), :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 %> + <%= link_to l(:label_issue_view_all), project_issues_path(@project, :set_filter => 1) %> <% if User.current.allowed_to?(:view_calendar, @project, :global => true) %> - | <%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %> + | <%= link_to l(:label_calendar), project_calendar_path(@project) %> <% end %> <% if User.current.allowed_to?(:view_gantt, @project, :global => true) %> - | <%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %> + | <%= link_to l(:label_gantt), project_gantt_path(@project) %> <% end %> </p> </div> @@ -72,7 +70,7 @@ <div class="news box"> <h3><%=l(:label_news_latest)%></h3> <%= render :partial => 'news/news', :collection => @news %> - <p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p> + <p><%= link_to l(:label_news_view_all), project_news_index_path(@project) %></p> </div> <% end %> <%= call_hook(:view_projects_show_right, :project => @project) %> diff --git a/config/routes.rb b/config/routes.rb index ad1465f20..209c70162 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -51,10 +51,10 @@ RedmineApp::Application.routes.draw do match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post] - get '/projects/:project_id/issues/gantt', :to => 'gantts#show' + get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt' get '/issues/gantt', :to => 'gantts#show' - get '/projects/:project_id/issues/calendar', :to => 'calendars#show' + get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar' get '/issues/calendar', :to => 'calendars#show' match 'projects/:id/issues/report', :to => 'reports#issue_report', :via => :get |