move assembly of reports list into controller

pull/3391/head
Jan Sandbrink 9 years ago committed by Henriette Dinger
parent 9479607122
commit 2b7261b2ee
  1. 19
      app/controllers/work_packages/reports_controller.rb
  2. 4
      app/views/work_packages/reports/report.html.erb

@ -34,14 +34,17 @@ class WorkPackages::ReportsController < ApplicationController
def report
reports_service = Reports::ReportsService.new(@project)
@type_report = reports_service.report_for('type')
@priority_report = reports_service.report_for('priority')
@assignee_report = reports_service.report_for('assigned_to')
@responsible_report = reports_service.report_for('responsible')
@author_report = reports_service.report_for('author')
@version_report = reports_service.report_for('version')
@subproject_report = reports_service.report_for('subproject')
@category_report = reports_service.report_for('category')
@reports = [
reports_service.report_for('type'),
reports_service.report_for('priority'),
reports_service.report_for('assigned_to'),
reports_service.report_for('responsible'),
reports_service.report_for('author'),
reports_service.report_for('version'),
reports_service.report_for('category')
]
@reports << reports_service.report_for('subproject') if @project.children.any?
end
def report_details

@ -28,9 +28,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<% html_title l(:label_summary) %>
<%= toolbar title: l(:label_summary) %>
<% reports = [@author_report, @type_report, @priority_report, @version_report, @category_report, @assignee_report, @responsible_report]
reports << @subproject_report if @project.children.any? %>
<% reports.each do |report| %>
<% @reports.each do |report| %>
<%= render :partial => 'report_category', :locals => { report: report} %>
<% end %>
<%= call_hook(:view_reports_issue_report, :project => @project) %>

Loading…
Cancel
Save