]> source.dussan.org Git - redmine.git/commitdiff
Extracted the rendering from each case statement in issue_reports_details
authorEric Davis <edavis@littlestreamsoftware.com>
Tue, 9 Feb 2010 16:47:27 +0000 (16:47 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Tue, 9 Feb 2010 16:47:27 +0000 (16:47 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3401 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/reports_controller.rb

index ef2ffd339fdb080d437d69164bd92e787ecf64d9..93bfdfe218d558605c30f713792b961671f9d1b7 100644 (file)
@@ -49,47 +49,45 @@ class ReportsController < ApplicationController
       @rows = @project.trackers
       @data = issues_by_tracker
       @report_title = l(:field_tracker)
-      render :template => "reports/issue_report_details"
     when "version"
       @field = "fixed_version_id"
       @rows = @project.shared_versions.sort
       @data = issues_by_version
       @report_title = l(:field_version)
-      render :template => "reports/issue_report_details"
     when "priority"
       @field = "priority_id"
       @rows = IssuePriority.all
       @data = issues_by_priority
       @report_title = l(:field_priority)
-      render :template => "reports/issue_report_details"   
     when "category"
       @field = "category_id"
       @rows = @project.issue_categories
       @data = issues_by_category
       @report_title = l(:field_category)
-      render :template => "reports/issue_report_details"   
     when "assigned_to"
       @field = "assigned_to_id"
       @rows = @project.members.collect { |m| m.user }.sort
       @data = issues_by_assigned_to
       @report_title = l(:field_assigned_to)
-      render :template => "reports/issue_report_details"
     when "author"
       @field = "author_id"
       @rows = @project.members.collect { |m| m.user }.sort
       @data = issues_by_author
       @report_title = l(:field_author)
-      render :template => "reports/issue_report_details"  
     when "subproject"
       @field = "project_id"
       @rows = @project.descendants.active
       @data = issues_by_subproject
       @report_title = l(:field_subproject)
-      render :template => "reports/issue_report_details"  
-    else
-      redirect_to :action => 'issue_report', :id => @project
     end
 
+    respond_to do |format|
+      if @field
+        format.html {}
+      else
+        format.html { redirect_to :action => 'issue_report', :id => @project }
+      end
+    end
   end
 private
   def issues_by_tracker