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 some more PageHeaders with the Primer component

Henriette Darge087dad81e3d9
diff --git a/app/views/account/lost_password.html.erb b/app/views/account/lost_password.html.erb
index 5f2859f265c..1a5fced1d7c 100644
--- a/app/views/account/lost_password.html.erb
+++ b/app/views/account/lost_password.html.erb
@@ -27,7 +27,15 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title t(:label_password_lost) %>
-<%= toolbar title: t(:label_password_lost) %>
+
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t(:label_password_lost) }
+ header.with_breadcrumbs([{ href: home_path, text: organization_name },
+ t(:label_password_lost)])
+ end
+%>
+
<section class="form--section">
<%= styled_form_tag({action: "lost_password"}) do %>
<div class="form--field -required">
diff --git a/app/views/account/password_recovery.html.erb b/app/views/account/password_recovery.html.erb
index 47b1f76db29..3e33e162f62 100644
--- a/app/views/account/password_recovery.html.erb
+++ b/app/views/account/password_recovery.html.erb
@@ -27,7 +27,15 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title t(:label_password_lost) %>
-<%= toolbar title: t(:label_password_lost) %>
+
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t(:label_password_lost) }
+ header.with_breadcrumbs([{ href: home_path, text: organization_name },
+ t(:label_password_lost)])
+ end
+%>
+
<%= error_messages_for 'user' %>
<%= styled_form_tag({token: @token.value}, autocomplete: 'off') do %>
<section class="form--section">
diff --git a/app/views/colors/confirm_destroy.html.erb b/app/views/colors/confirm_destroy.html.erb
index 878cb53b178..a8bd724e919 100644
--- a/app/views/colors/confirm_destroy.html.erb
+++ b/app/views/colors/confirm_destroy.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: @color.name %>
+
+<%=
+ render(Primer::OpenProject::PageHeader.new) do |header|
+ header.with_title { @color.name }
+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },
+ { href: colors_path, text: t(:label_color_plural) },
+ @color.name])
+ end
+%>
+
<%= labelled_tabular_form_for @color,
url: color_url(@color),
html: {method: 'delete'},
diff --git a/app/views/messages/edit.html.erb b/app/views/messages/edit.html.erb
index 3900b636238..f906ee6ed30 100644
--- a/app/views/messages/edit.html.erb
+++ b/app/views/messages/edit.html.erb
@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.
header.with_breadcrumbs( [{ href: project_overview_path(@project.id), text: @project.name },
{ href: project_forums_path(@project), text: t(:label_forum_plural) },
{ href: project_forum_path(@project, @forum), text: @forum.name },
- "#{ @message.subject }: <b>#{t(:label_edit)}</b>".html_safe], selected_item_font_weight: :normal)
+ @message.subject])
end %>
<%= labelled_tabular_form_for @message,
diff --git a/modules/budgets/app/views/budgets/destroy_info.html.erb b/modules/budgets/app/views/budgets/destroy_info.html.erb
index ac3a43a50ef..2986837d068 100644
--- a/modules/budgets/app/views/budgets/destroy_info.html.erb
+++ b/modules/budgets/app/views/budgets/destroy_info.html.erb
@@ -28,7 +28,15 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title "#{t(:button_delete)} #{t(:label_budget_id, id: @budget.id)}: #{@budget.subject}" %>
-<%= toolbar title: "#{t(:button_delete)} #{t(:label_budget_id, id: @budget.id)}: #{@budget.subject}" %>
+
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { "#{t(:button_delete)} #{@budget.subject}" }
+ header.with_breadcrumbs([{href: project_overview_path(@project.identifier), text: @project.name},
+ {href: projects_budgets_path(@project.identifier), text: I18n.t(:label_budget_plural)},
+ "#{t(:button_delete)} #{@budget.subject}"])
+ end
+%>
<%= styled_form_tag(budget_path(@budget), method: :delete) do %>
<section class="form--section">
diff --git a/modules/costs/app/views/hourly_rates/edit.html.erb b/modules/costs/app/views/hourly_rates/edit.html.erb
index d8a03409a7b..96a630f690c 100644
--- a/modules/costs/app/views/hourly_rates/edit.html.erb
+++ b/modules/costs/app/views/hourly_rates/edit.html.erb
@@ -29,7 +29,23 @@ See COPYRIGHT and LICENSE files for more details.
<% html_title t(:label_administration), "#{t(:label_edit)} #{I18n.t((@project.nil? ? :caption_default_rate_history_for : :caption_rate_history_for), user: ' ')} #{@user.name}" %>
-<%= toolbar title: (@project.nil? ? t(:caption_default_rate_history_for, user: @user.name) : t(:caption_rate_history_for_project, user: @user.name, project: @project.name) ) %>
+<%
+ breadcrumb_items = if @project
+ [{href: project_overview_path(@project.identifier), text: @project.name},
+ {href: projects_budgets_path(@project.identifier), text: I18n.t(:label_budget_plural)}]
+ else
+ [{ href: home_path, text: organization_name}]
+ end
+%>
+
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t(:caption_default_rate_history_for, user: @user.name) }
+ header.with_breadcrumbs([*(breadcrumb_items),
+ t(:caption_default_rate_history_for, user: @user.name)])
+ end
+%>
+
<%- default_rate = @user.current_default_rate -%>
<% if default_rate%>
diff --git a/modules/costs/app/views/hourly_rates/show.html.erb b/modules/costs/app/views/hourly_rates/show.html.erb
index ed75efed51e..58ff0dee390 100644
--- a/modules/costs/app/views/hourly_rates/show.html.erb
+++ b/modules/costs/app/views/hourly_rates/show.html.erb
@@ -29,15 +29,28 @@ See COPYRIGHT and LICENSE files for more details.
<% html_title t(:label_administration), t(:caption_rate_history_for, user: @user.name) %>
-<%= toolbar title: t(:caption_rate_history_for, :user => @user.name) %>
+<%
+ breadcrumb_items = if @project
+ [{href: project_overview_path(@project.identifier), text: @project.name},
+ {href: projects_budgets_path(@project.identifier), text: I18n.t(:label_budget_plural)}]
+ else
+ [{ href: home_path, text: organization_name}]
+ end
+%>
+
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t(:caption_default_rate_history_for, user: @user.name) }
+ header.with_breadcrumbs([*(breadcrumb_items),
+ t(:caption_default_rate_history_for, user: @user.name)])
+ end
+%>
<% if @project %>
<% html_title t(:caption_rate_history_for, user: @user.name) %>
<%= render :partial => 'list_project' %>
<% else %>
- <% html_title t(:label_administration), t(:caption_rate_history_for, user: @user.name) %>
-
<%= render :partial => 'list_default' %>
<%= render :partial => 'list' %>
<% end %>
diff --git a/modules/two_factor_authentication/app/views/two_factor_authentication/two_factor_devices/new_type.html.erb b/modules/two_factor_authentication/app/views/two_factor_authentication/two_factor_devices/new_type.html.erb
index 64dc167e2c3..d6638f10059 100644
--- a/modules/two_factor_authentication/app/views/two_factor_authentication/two_factor_devices/new_type.html.erb
+++ b/modules/two_factor_authentication/app/views/two_factor_authentication/two_factor_devices/new_type.html.erb
@@ -7,7 +7,6 @@
t('two_factor_authentication.devices.add_new')])
end
%>
-<%= toolbar title: t('two_factor_authentication.devices.add_new') %>
<div class="mobile-otp-new-devices">
<% @available_devices.each do |key, device_class| %>
diff --git a/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb b/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb
index a1aa59dffc0..de14ab84c7b 100644
--- a/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb
+++ b/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb
@@ -25,28 +25,21 @@
</section>
<section class="admin--edit-section">
- <%= toolbar title: t('two_factor_authentication.label_devices') do %>
- <% unless devices.empty? %>
- <li class="toolbar-item">
- <%= link_to delete_all_user_2fa_devices_path(@user),
- method: :post,
- data: { confirm: t('two_factor_authentication.admin.delete_all_are_you_sure') },
- class: "button -danger" do %>
- <%= op_icon 'button--icon icon-delete' %>
- <span class="button--text"><%= t 'two_factor_authentication.admin.button_delete_all_devices' %></span>
- <% end %>
- </li>
- <% end %>
- <% if ::OpenProject::TwoFactorAuthentication::TokenStrategyManager.admin_register_sms_strategy.present? %>
- <li class="toolbar-item">
- <%= link_to new_user_2fa_device_path(@user, type: :sms), class: 'button -primary' do %>
- <%= op_icon 'button--icon icon-add' %>
- <span class="button--text"><%= t 'two_factor_authentication.admin.button_register_mobile_phone_for_user' %></span>
- <% end %>
- </li>
- <% end %>
+ <% unless devices.empty? %>
+ <%= link_to delete_all_user_2fa_devices_path(@user),
+ method: :post,
+ data: { confirm: t('two_factor_authentication.admin.delete_all_are_you_sure') },
+ class: "button -danger" do %>
+ <%= op_icon 'button--icon icon-delete' %>
+ <span class="button--text"><%= t 'two_factor_authentication.admin.button_delete_all_devices' %></span>
+ <% end %>
+ <% end %>
+ <% if ::OpenProject::TwoFactorAuthentication::TokenStrategyManager.admin_register_sms_strategy.present? %>
+ <%= link_to new_user_2fa_device_path(@user, type: :sms), class: 'button -primary' do %>
+ <%= op_icon 'button--icon icon-add' %>
+ <span class="button--text"><%= t 'two_factor_authentication.admin.button_register_mobile_phone_for_user' %></span>
+ <% end %>
<% end %>
<%= render ::TwoFactorAuthentication::Devices::TableComponent.new(rows: devices, admin_table: true || @user != User.current) %>
- </div>
</section>