summaryrefslogtreecommitdiffstats
path: root/app/views/reports
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-23 15:55:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-23 15:55:57 +0000
commit4ac43ab876319acb828aedc1c7cc0210f4cb0d9e (patch)
treedf6f5c6a854d00911a4648b95f6842f5af4e9eec /app/views/reports
parent3ef7f5855edc1193755097a4ef981ff67ea4ae56 (diff)
downloadredmine-4ac43ab876319acb828aedc1c7cc0210f4cb0d9e.tar.gz
redmine-4ac43ab876319acb828aedc1c7cc0210f4cb0d9e.zip
Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11077 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/reports')
-rw-r--r--app/views/reports/_details.html.erb33
-rw-r--r--app/views/reports/_simple.html.erb26
-rw-r--r--app/views/reports/issue_report.html.erb14
-rw-r--r--app/views/reports/issue_report_details.html.erb2
4 files changed, 17 insertions, 58 deletions
diff --git a/app/views/reports/_details.html.erb b/app/views/reports/_details.html.erb
index 47eda9909..4a01c7333 100644
--- a/app/views/reports/_details.html.erb
+++ b/app/views/reports/_details.html.erb
@@ -15,36 +15,13 @@
<tbody>
<% for row in rows %>
<tr class="<%= cycle("odd", "even") %>">
- <td><%= link_to h(row.name), :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
- :set_filter => 1,
- :subproject_id => '!*',
- "#{field_name}" => row.id %></td>
+ <td><%= link_to h(row.name), aggregate_path(@project, field_name, row) %></td>
<% for status in @statuses %>
- <td align="center"><%= aggregate_link data, { field_name => row.id, "status_id" => status.id },
- :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
- :set_filter => 1,
- :subproject_id => '!*',
- "status_id" => status.id,
- "#{field_name}" => row.id %></td>
+ <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>
<% end %>
- <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 0 },
- :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
- :set_filter => 1,
- :subproject_id => '!*',
- "#{field_name}" => row.id,
- "status_id" => "o" %></td>
- <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 1 },
- :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
- :set_filter => 1,
- :subproject_id => '!*',
- "#{field_name}" => row.id,
- "status_id" => "c" %></td>
- <td align="center"><%= aggregate_link data, { field_name => row.id },
- :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
- :set_filter => 1,
- :subproject_id => '!*',
- "#{field_name}" => row.id,
- "status_id" => "*" %></td>
+ <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 0 }, aggregate_path(@project, field_name, row, :status_id => "o") %></td>
+ <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 1 }, aggregate_path(@project, field_name, row, :status_id => "c") %></td>
+ <td align="center"><%= aggregate_link data, { field_name => row.id }, aggregate_path(@project, field_name, row, :status_id => "*") %></td>
</tr>
<% end %>
</tbody>
diff --git a/app/views/reports/_simple.html.erb b/app/views/reports/_simple.html.erb
index 46f4a9fd4..8ea18f16f 100644
--- a/app/views/reports/_simple.html.erb
+++ b/app/views/reports/_simple.html.erb
@@ -11,28 +11,10 @@
<tbody>
<% for row in rows %>
<tr class="<%= cycle("odd", "even") %>">
- <td><%= link_to h(row.name), :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
- :set_filter => 1,
- :subproject_id => '!*',
- "#{field_name}" => row.id %></td>
- <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 0 },
- :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
- :set_filter => 1,
- :subproject_id => '!*',
- "#{field_name}" => row.id,
- "status_id" => "o" %></td>
- <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 1 },
- :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
- :set_filter => 1,
- :subproject_id => '!*',
- "#{field_name}" => row.id,
- "status_id" => "c" %></td>
- <td align="center"><%= aggregate_link data, { field_name => row.id },
- :controller => 'issues', :action => 'index', :project_id => ((row.is_a?(Project) ? row : @project)),
- :set_filter => 1,
- :subproject_id => '!*',
- "#{field_name}" => row.id,
- "status_id" => "*" %></td>
+ <td><%= link_to h(row.name), aggregate_path(@project, field_name, row) %></td>
+ <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 0 }, aggregate_path(@project, field_name, row, :status_id => "o") %></td>
+ <td align="center"><%= aggregate_link data, { field_name => row.id, "closed" => 1 }, aggregate_path(@project, field_name, row, :status_id => "c") %></td>
+ <td align="center"><%= aggregate_link data, { field_name => row.id }, aggregate_path(@project, field_name, row, :status_id => "*") %></td>
</tr>
<% end %>
</tbody>
diff --git a/app/views/reports/issue_report.html.erb b/app/views/reports/issue_report.html.erb
index d70d429bb..d40841dae 100644
--- a/app/views/reports/issue_report.html.erb
+++ b/app/views/reports/issue_report.html.erb
@@ -1,31 +1,31 @@
<h2><%=l(:label_report_plural)%></h2>
<div class="splitcontentleft">
-<h3><%=l(:field_tracker)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'tracker' %></h3>
+<h3><%=l(:field_tracker)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'tracker') %></h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_tracker, :field_name => "tracker_id", :rows => @trackers } %>
<br />
-<h3><%=l(:field_priority)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'priority' %></h3>
+<h3><%=l(:field_priority)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'priority') %></h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
<br />
-<h3><%=l(:field_assigned_to)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'assigned_to' %></h3>
+<h3><%=l(:field_assigned_to)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'assigned_to') %></h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_assigned_to, :field_name => "assigned_to_id", :rows => @assignees } %>
<br />
-<h3><%=l(:field_author)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'author' %></h3>
+<h3><%=l(:field_author)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'author') %></h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %>
<br />
<%= call_hook(:view_reports_issue_report_split_content_left, :project => @project) %>
</div>
<div class="splitcontentright">
-<h3><%=l(:field_version)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'version' %></h3>
+<h3><%=l(:field_version)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'version') %></h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_version, :field_name => "fixed_version_id", :rows => @versions } %>
<br />
<% if @project.children.any? %>
-<h3><%=l(:field_subproject)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'subproject' %></h3>
+<h3><%=l(:field_subproject)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'subproject') %></h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_subproject, :field_name => "project_id", :rows => @subprojects } %>
<br />
<% end %>
-<h3><%=l(:field_category)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'category' %></h3>
+<h3><%=l(:field_category)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), project_issues_report_details_path(@project, :detail => 'category') %></h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_category, :field_name => "category_id", :rows => @categories } %>
<br />
<%= call_hook(:view_reports_issue_report_split_content_right, :project => @project) %>
diff --git a/app/views/reports/issue_report_details.html.erb b/app/views/reports/issue_report_details.html.erb
index 6b4b42232..be7259d6b 100644
--- a/app/views/reports/issue_report_details.html.erb
+++ b/app/views/reports/issue_report_details.html.erb
@@ -3,5 +3,5 @@
<h3><%=@report_title%></h3>
<%= render :partial => 'details', :locals => { :data => @data, :field_name => @field, :rows => @rows } %>
<br />
-<%= link_to l(:button_back), :action => 'issue_report' %>
+<%= link_to l(:button_back), project_issues_report_path(@project) %>