diff --git a/app/controllers/admin/reports_controller.rb b/app/controllers/admin/reports_controller.rb index 7f00bb32a4..9c88a0bd09 100644 --- a/app/controllers/admin/reports_controller.rb +++ b/app/controllers/admin/reports_controller.rb @@ -43,6 +43,11 @@ module Admin @report_type = report_type @report_subtypes = report_subtypes @report_subtype = report_subtype + @report_title = if report_subtype + report_subtype_title + else + I18n.t(:name, scope: [:admin, :reports, @report_type]) + end # Initialize data params[:display_summary_row] = true if request.get? diff --git a/app/controllers/concerns/reports_actions.rb b/app/controllers/concerns/reports_actions.rb index 35a508b154..6cd9e5157c 100644 --- a/app/controllers/concerns/reports_actions.rb +++ b/app/controllers/concerns/reports_actions.rb @@ -39,6 +39,10 @@ module ReportsActions params[:report_subtype] || report_subtypes_codes.first end + def report_subtype_title + report_subtypes.select { |_name, key| key.to_sym == report_subtype.to_sym }.first[0] + end + def ransack_params raw_params[:q] end diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml index 3fc60d9d8b..caebd55c83 100644 --- a/app/views/admin/reports/show.html.haml +++ b/app/views/admin/reports/show.html.haml @@ -1,3 +1,6 @@ +- content_for :page_title do + = @report_title + = form_for @report.search, :url => url_for(only_path: false) do |f| %fieldset.no-border-bottom.print-hidden %legend{ align: 'center'}= t(:report_filters)