Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

move button from subheader to header in cost reports page

Behrokh Satarnejad6a4eeb2b7ff6
diff --git a/modules/reporting/app/views/cost_reports/index.html.erb b/modules/reporting/app/views/cost_reports/index.html.erb
index a78ead76e2e..7ee8d29e6bd 100644
--- a/modules/reporting/app/views/cost_reports/index.html.erb
+++ b/modules/reporting/app/views/cost_reports/index.html.erb
@@ -42,24 +42,23 @@ See COPYRIGHT and LICENSE files for more details.
*([href: project_overview_path(@project.id), text: @project.name] if @project),
{ href: url_for({ controller: "cost_reports" , action: :index, project_id: @project }), text: I18n.t(:cost_reports_title)},
(@query.persisted? ? "#{@query.name}" : t(:label_new_report))])
- end
-%>
-<% if User.current.allowed_in_any_work_package?(:export_work_packages, in_project: @project) %>
- <%=
- render(Primer::OpenProject::SubHeader.new) do |subheader|
- subheader.with_action_button(scheme: :default,
- aria: { label: t(:export_to_excel)},
- title: t(:export_to_excel),
- tag: :a,
- href: url_for({ controller: "cost_reports" , action: :index, format: 'xls', project_id: @project })
- ) do |button|
+
+ if User.current.allowed_in_any_work_package?(:export_work_packages, in_project: @project)
+ header.with_action_button(scheme: :default,
+ aria: { label: t(:export_to_excel)},
+ title: t(:export_to_excel),
+ mobile_icon: "op-file-xls-descriptions",
+ mobile_label: t(:export_to_excel),
+ tag: :a,
+ href: url_for({ controller: "cost_reports" , action: :index, format: 'xls', project_id: @project })
+ ) do |button|
button.with_leading_visual_icon(icon: "op-file-xls-descriptions")
t(:export_to_excel)
end
+ call_hook(:view_cost_report_toolbar)
end
- %>
- <%= call_hook(:view_cost_report_toolbar) %>
-<% end %>
+ end
+%>
<%= render_widget Widget::Settings, @query, :cost_types => @cost_types, :selected_type_id => @unit_id %>