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 pageHeaders with "check all/uncheck all" links with Primer components. Thereby we drop that functionality for now. If we want to re-add it, we have to put it as part of the content

Henriette Darge5c7ec9e282f0
diff --git a/app/views/projects/settings/_form_toolbar.html.erb b/app/views/projects/settings/_form_toolbar.html.erb
deleted file mode 100644
index 0ec768f8942..00000000000
--- a/app/views/projects/settings/_form_toolbar.html.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<li class="form--toolbar-item -in-header">
- (<%= check_all_links form_name %>)
-</li>
diff --git a/app/views/projects/settings/custom_fields/show.html.erb b/app/views/projects/settings/custom_fields/show.html.erb
index 02e41583820..b779df10af6 100644
--- a/app/views/projects/settings/custom_fields/show.html.erb
+++ b/app/views/projects/settings/custom_fields/show.html.erb
@@ -27,21 +27,29 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= toolbar title: t(:label_custom_field_plural) , html: { class: '-minimum-title' } do -%>
- <%= render partial: 'projects/settings/form_toolbar', locals: { form_name: "modules-form" } %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { I18n.t(:label_custom_field_plural) }
+ header.with_breadcrumbs( [ { href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
+ I18n.t(:label_custom_field_plural)])
+ end
+%>
- <% if current_user.admin? %>
- <li class="toolbar-item -no-grow">
- <%= link_to new_custom_field_path(type: 'WorkPackageCustomField'),
- { class: 'button -primary',
- aria: {label: t(:label_custom_field_new)},
- title: t(:label_custom_field_new)} do %>
- <%= op_icon('button--icon icon-add') %>
- <span class="button--text"><%= CustomField.model_name.human %></span>
- <% end %>
- </li>
- <% end %>
-<% end %>
+<%=
+ if current_user.admin?
+ render(Primer::OpenProject::SubHeader.new) do |subheader|
+ subheader.with_action_button(scheme: :primary,
+ aria: { label: t(:label_custom_field_new)},
+ title: I18n.t(:label_custom_field_new),
+ tag: :a,
+ href: new_custom_field_path(type: 'WorkPackageCustomField')) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ CustomField.model_name.human
+ end
+ end
+ end
+%>
<% if @wp_custom_fields.any? %>
<%= labelled_tabular_form_for @project,
diff --git a/app/views/projects/settings/modules/show.html.erb b/app/views/projects/settings/modules/show.html.erb
index 08fe1ab7448..f848b2ffd6a 100644
--- a/app/views/projects/settings/modules/show.html.erb
+++ b/app/views/projects/settings/modules/show.html.erb
@@ -27,9 +27,14 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= toolbar title: t(:label_module_plural), html: { class: '-minimum-title' } do -%>
- <%= render partial: 'projects/settings/form_toolbar', locals: { form_name: "edit_project_#{@project.id}" } %>
-<% end %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { I18n.t(:label_module_plural) }
+ header.with_breadcrumbs( [ { href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
+ I18n.t(:label_module_plural)])
+ end
+%>
<%= error_messages_for(@project) %>
diff --git a/app/views/projects/settings/repository/show.html.erb b/app/views/projects/settings/repository/show.html.erb
index ca93b4ec114..26d5542ec93 100644
--- a/app/views/projects/settings/repository/show.html.erb
+++ b/app/views/projects/settings/repository/show.html.erb
@@ -27,7 +27,14 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= toolbar title: t(:label_repository) %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t(:label_repository) }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
+ t(:label_repository)])
+ end
+%>
<% is_creation_form = @repository.nil? || @repository.new_record? %>
<%= form_for :repository,
diff --git a/app/views/projects/settings/types/show.html.erb b/app/views/projects/settings/types/show.html.erb
index fc053d7105c..fd28b8ce8ce 100644
--- a/app/views/projects/settings/types/show.html.erb
+++ b/app/views/projects/settings/types/show.html.erb
@@ -27,9 +27,14 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= toolbar title: t(:label_work_package_types), html: { class: '-minimum-title' } do -%>
- <%= render partial: 'projects/settings/form_toolbar', locals: { form_name: "types-form" } %>
-<% end %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { I18n.t(:label_work_package_types) }
+ header.with_breadcrumbs( [ { href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
+ I18n.t(:label_work_package_types)])
+ end
+%>
<% if Type.any? %>
<%= form_for @project,
diff --git a/frontend/src/global_styles/content/_forms.sass b/frontend/src/global_styles/content/_forms.sass
index 3d31e444841..6598d59069e 100644
--- a/frontend/src/global_styles/content/_forms.sass
+++ b/frontend/src/global_styles/content/_forms.sass
@@ -292,12 +292,6 @@ fieldset.form--fieldset
padding: 0 0.25rem
background-color: inherit
- &.-in-header
- margin-left: 5px
- margin-bottom: 5px
- font-style: italic
- line-height: 44px
-
.form--section
@extend %form--fieldset-or-section
diff --git a/frontend/src/global_styles/layout/_toolbar.sass b/frontend/src/global_styles/layout/_toolbar.sass
index c976a327072..3ed0569ff9c 100644
--- a/frontend/src/global_styles/layout/_toolbar.sass
+++ b/frontend/src/global_styles/layout/_toolbar.sass
@@ -61,14 +61,6 @@ $nm-color-success-background: #d8fdd1
&.-with-dropdown .toolbar-item.drop-down
position: relative
- &.-minimum-title
- .toolbar-items
- flex-grow: 1
-
- .title-container
- flex-grow: 0
- flex-basis: auto
-
// Align title and toolbar with flex
.toolbar
display: flex
diff --git a/modules/backlogs/app/views/projects/settings/backlogs/show.html.erb b/modules/backlogs/app/views/projects/settings/backlogs/show.html.erb
index 6a1881bda2e..ab0a4eb1b0e 100644
--- a/modules/backlogs/app/views/projects/settings/backlogs/show.html.erb
+++ b/modules/backlogs/app/views/projects/settings/backlogs/show.html.erb
@@ -27,9 +27,14 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= toolbar title: t('backlogs.definition_of_done'), html: { class: '-minimum-title' } do -%>
- <%= render partial: 'projects/settings/form_toolbar', locals: { form_name: "edit_project_#{@project.id}" } %>
-<% end %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t('backlogs.definition_of_done') }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t(:label_project_settings) },
+ t('backlogs.definition_of_done')])
+ end
+%>
<%= styled_form_tag(project_settings_backlogs_path(@project),
method: :patch,
diff --git a/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erb b/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erb
index 1e3930c9fe3..e4efde66e1e 100644
--- a/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erb
+++ b/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erb
@@ -26,9 +26,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= toolbar title: t(:enumeration_activities), html: { class: '-minimum-title' } do -%>
- <%= render partial: 'projects/settings/form_toolbar', locals: { form_name: "edit_project_#{@project.id}" } %>
-<% end %>
+
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t(:enumeration_activities) }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t(:label_project_settings) },
+ t(:enumeration_activities)])
+ end
+%>
<% if TimeEntryActivity.any? %>
<%= labelled_tabular_form_for @project,