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

Replace rails toolbars with Primer::PageHeader in BCF module

Henriette Dargea581547368ca
diff --git a/modules/bim/app/views/bim/bcf/issues/configure_invalid_people.html.erb b/modules/bim/app/views/bim/bcf/issues/configure_invalid_people.html.erb
index 8a2d8eb4320..8f8587dd1a2 100644
--- a/modules/bim/app/views/bim/bcf/issues/configure_invalid_people.html.erb
+++ b/modules/bim/app/views/bim/bcf/issues/configure_invalid_people.html.erb
@@ -1,4 +1,11 @@
-<%= toolbar title: t('bcf.bcf_xml.import_title') %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t("bcf.bcf_xml.import_title") }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: defaults_bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"bcf.label_bcf") },
+ t("bcf.bcf_xml.import_title")])
+ end
+%>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.invalid_emails_found'),
diff --git a/modules/bim/app/views/bim/bcf/issues/configure_non_members.html.erb b/modules/bim/app/views/bim/bcf/issues/configure_non_members.html.erb
index d68dd121e82..c0710cf4b6b 100644
--- a/modules/bim/app/views/bim/bcf/issues/configure_non_members.html.erb
+++ b/modules/bim/app/views/bim/bcf/issues/configure_non_members.html.erb
@@ -1,4 +1,11 @@
-<%= toolbar title: t('bcf.bcf_xml.import_title') %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t("bcf.bcf_xml.import_title") }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: defaults_bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"bcf.label_bcf") },
+ t("bcf.bcf_xml.import_title")])
+ end
+%>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.non_members_found'),
@@ -35,4 +42,3 @@
class: 'button' %>
<% end %>
<% end %>
-
diff --git a/modules/bim/app/views/bim/bcf/issues/configure_unknown_mails.html.erb b/modules/bim/app/views/bim/bcf/issues/configure_unknown_mails.html.erb
index f0ff818f215..c37e4087c61 100644
--- a/modules/bim/app/views/bim/bcf/issues/configure_unknown_mails.html.erb
+++ b/modules/bim/app/views/bim/bcf/issues/configure_unknown_mails.html.erb
@@ -1,4 +1,11 @@
-<%= toolbar title: t('bcf.bcf_xml.import_title') %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t("bcf.bcf_xml.import_title") }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: defaults_bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"bcf.label_bcf") },
+ t("bcf.bcf_xml.import_title")])
+ end
+%>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.unknown_emails_found'),
diff --git a/modules/bim/app/views/bim/bcf/issues/configure_unknown_priorities.html.erb b/modules/bim/app/views/bim/bcf/issues/configure_unknown_priorities.html.erb
index 9202a214d75..a62a19feb03 100644
--- a/modules/bim/app/views/bim/bcf/issues/configure_unknown_priorities.html.erb
+++ b/modules/bim/app/views/bim/bcf/issues/configure_unknown_priorities.html.erb
@@ -1,4 +1,11 @@
-<%= toolbar title: t('bcf.bcf_xml.import_title') %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t("bcf.bcf_xml.import_title") }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: defaults_bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"bcf.label_bcf") },
+ t("bcf.bcf_xml.import_title")])
+ end
+%>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post, class: '-vertical') do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.invalid_priorities_found'),
diff --git a/modules/bim/app/views/bim/bcf/issues/configure_unknown_statuses.html.erb b/modules/bim/app/views/bim/bcf/issues/configure_unknown_statuses.html.erb
index c9b8a324acc..da24692033b 100644
--- a/modules/bim/app/views/bim/bcf/issues/configure_unknown_statuses.html.erb
+++ b/modules/bim/app/views/bim/bcf/issues/configure_unknown_statuses.html.erb
@@ -1,4 +1,11 @@
-<%= toolbar title: t('bcf.bcf_xml.import_title') %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t("bcf.bcf_xml.import_title") }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: defaults_bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"bcf.label_bcf") },
+ t("bcf.bcf_xml.import_title")])
+ end
+%>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post, class: '-vertical') do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.invalid_statuses_found'),
diff --git a/modules/bim/app/views/bim/bcf/issues/configure_unknown_types.html.erb b/modules/bim/app/views/bim/bcf/issues/configure_unknown_types.html.erb
index b665d4764c0..23fd542d7ad 100644
--- a/modules/bim/app/views/bim/bcf/issues/configure_unknown_types.html.erb
+++ b/modules/bim/app/views/bim/bcf/issues/configure_unknown_types.html.erb
@@ -1,4 +1,11 @@
-<%= toolbar title: t('bcf.bcf_xml.import_title') %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t("bcf.bcf_xml.import_title") }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: defaults_bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"bcf.label_bcf") },
+ t("bcf.bcf_xml.import_title")])
+ end
+%>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post, class: '-vertical') do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.invalid_types_found'),
diff --git a/modules/bim/app/views/bim/bcf/issues/perform_import.html.erb b/modules/bim/app/views/bim/bcf/issues/perform_import.html.erb
index cd7a1196aff..f04c750c717 100644
--- a/modules/bim/app/views/bim/bcf/issues/perform_import.html.erb
+++ b/modules/bim/app/views/bim/bcf/issues/perform_import.html.erb
@@ -1,6 +1,14 @@
<link rel="stylesheet" href="/highlighting/styles.css" />
-<%= toolbar title: t(:label_summary) %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t(:label_summary) }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: defaults_bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"bcf.label_bcf") },
+ I18n.t("menus.breadcrumb.nested_element", section_header: t("bcf.bcf_xml.import_title"), title: t(:label_summary)).html_safe],
+ selected_item_font_weight: :normal)
+ end
+%>
<%= link_to t('bcf.bcf_xml.import.button_back_to_list'),
defaults_bcf_project_ifc_models_path(@project),
diff --git a/modules/bim/app/views/bim/bcf/issues/upload.html.erb b/modules/bim/app/views/bim/bcf/issues/upload.html.erb
index ed39731dee5..198f8aea688 100644
--- a/modules/bim/app/views/bim/bcf/issues/upload.html.erb
+++ b/modules/bim/app/views/bim/bcf/issues/upload.html.erb
@@ -1,4 +1,11 @@
-<%= toolbar title: t('bcf.bcf_xml.import_title') %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t("bcf.bcf_xml.import_title") }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: defaults_bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"bcf.label_bcf") },
+ t("bcf.bcf_xml.import_title")])
+ end
+%>
<%= form_tag({ action: :prepare_import }, multipart: true, method: :post) do %>
diff --git a/modules/bim/app/views/bim/ifc_models/ifc_models/edit.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/edit.html.erb
index 65054e79ed8..e98dbc578d3 100644
--- a/modules/bim/app/views/bim/ifc_models/ifc_models/edit.html.erb
+++ b/modules/bim/app/views/bim/ifc_models/ifc_models/edit.html.erb
@@ -27,7 +27,15 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= toolbar title: Bim::IfcModels::IfcModel.model_name.human %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { @ifc_model.title }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: defaults_bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"bcf.label_bcf") },
+ { href: bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"ifc_models.label_ifc_models") },
+ @ifc_model.title ])
+ end
+%>
<%= labelled_tabular_form_for @ifc_model, url: bcf_project_ifc_model_path(@project, @ifc_model), method: 'PATCH' do |f| -%>
<%= error_messages_for @ifc_model %>
diff --git a/modules/bim/app/views/bim/ifc_models/ifc_models/index.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/index.html.erb
index 28ad26a7568..c0c18fec83b 100644
--- a/modules/bim/app/views/bim/ifc_models/ifc_models/index.html.erb
+++ b/modules/bim/app/views/bim/ifc_models/ifc_models/index.html.erb
@@ -28,30 +28,39 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title(t('ifc_models.label_ifc_models')) -%>
-<%= toolbar title: t('ifc_models.label_ifc_models') do %>
- <% if User.current.allowed_in_project?(:manage_ifc_models, @project) %>
- <li class="toolbar-item">
- <%= link_to new_bcf_project_ifc_model_path,
- { class: 'button -primary',
- aria: { label: t(:'ifc_models.label_new_ifc_model') },
- title: t(:'ifc_models.label_new_ifc_model') } do %>
- <%= op_icon('button--icon icon-add') %>
- <span class="button--text"><%= ::Bim::IfcModels::IfcModel.model_name.human %></span>
- <% end %>
- </li>
- <% end %>
- <% if @ifc_models.defaults.any? %>
- <li class="toolbar-item">
- <%= link_to defaults_bcf_project_ifc_models_path,
- { class: 'button',
- aria: { label: t('ifc_models.label_show_defaults') },
- title: t('ifc_models.label_show_defaults') } do %>
- <%= op_icon('button--icon icon-watched') %>
- <span class="button--text"><%= t('ifc_models.label_show_defaults') %></span>
- <% end %>
- </li>
- <% end %>
-<% end %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t("ifc_models.label_ifc_models") }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: defaults_bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"bcf.label_bcf") },
+ t("ifc_models.label_ifc_models")])
+
+ header.with_action_button(tag: :a,
+ mobile_icon: :"eye",
+ mobile_label: t("ifc_models.label_show_defaults"),
+ href: defaults_bcf_project_ifc_models_path,
+ aria: { label: I18n.t("ifc_models.label_show_defaults") },
+ title: I18n.t("ifc_models.label_show_defaults")) do |button|
+ button.with_leading_visual_icon(icon: :"eye")
+ t("ifc_models.label_show_defaults")
+ end
+ end
+%>
+
+<%=
+ if User.current.allowed_in_project?(:manage_ifc_models, @project)
+ render(Primer::OpenProject::SubHeader.new) do |subheader|
+ subheader.with_action_button(scheme: :primary,
+ aria: { label: I18n.t("ifc_models.label_new_ifc_model") },
+ title: I18n.t("ifc_models.label_new_ifc_model"),
+ tag: :a,
+ href: new_bcf_project_ifc_model_path) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ ::Bim::IfcModels::IfcModel.model_name.human
+ end
+ end
+ end
+%>
<% if @ifc_models.defaults.empty? %>
<%= render partial: 'no_default_notice', locals: { project: @project } %>
diff --git a/modules/bim/app/views/bim/ifc_models/ifc_models/new.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/new.html.erb
index 6a0e674f50a..2cfcf70d542 100644
--- a/modules/bim/app/views/bim/ifc_models/ifc_models/new.html.erb
+++ b/modules/bim/app/views/bim/ifc_models/ifc_models/new.html.erb
@@ -26,7 +26,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= toolbar title: t('ifc_models.label_new_ifc_model') %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t("ifc_models.label_new_ifc_model") }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: defaults_bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"bcf.label_bcf") },
+ { href: bcf_project_ifc_models_path(@project.identifier), text: I18n.t(:"ifc_models.label_ifc_models") },
+ t("ifc_models.label_new_ifc_model")])
+ end
+%>
+
<%= labelled_tabular_form_for @ifc_model, url: bcf_project_ifc_models_path(@project), html: { multipart: true } do |f| -%>
<%= error_messages_for @ifc_model %>