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

add header component to life cycle show page

ulfertse8b9c639c5e7
diff --git a/app/components/projects/settings/life_cycles/show_page_header_component.html.erb b/app/components/projects/settings/life_cycles/show_page_header_component.html.erb
new file mode 100644
index 00000000000..a090cf4fbbf
--- /dev/null
+++ b/app/components/projects/settings/life_cycles/show_page_header_component.html.erb
@@ -0,0 +1,9 @@
+<%= render Primer::OpenProject::PageHeader.new do |header| %>
+ <%= header.with_title(variant: :default) { t('projects.settings.life_cycle.header.title') } %>
+ <%= header.with_description {
+ t('projects.settings.life_cycle.header.description',
+ overview_url: project_path(@project),
+ admin_settings_url: admin_settings_project_life_cycles_path).html_safe
+ } %>
+ <%= header.with_breadcrumbs(breadcrumb_items) %>
+<% end %>
diff --git a/app/components/projects/settings/life_cycles/show_page_header_component.rb b/app/components/projects/settings/life_cycles/show_page_header_component.rb
new file mode 100644
index 00000000000..0b9f15fc85d
--- /dev/null
+++ b/app/components/projects/settings/life_cycles/show_page_header_component.rb
@@ -0,0 +1,46 @@
+# frozen_string_literal: true
+
+# -- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) 2010-2024 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.
+# ++
+
+module Projects::Settings::LifeCycles
+ class ShowPageHeaderComponent < ApplicationComponent
+ include ApplicationHelper
+
+ def initialize(project: nil)
+ super
+ @project = project
+ end
+
+ def breadcrumb_items
+ [{ href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
+ t("projects.settings.life_cycle.header.title")]
+ end
+ end
+end
diff --git a/app/views/projects/settings/life_cycles/show.html.erb b/app/views/projects/settings/life_cycles/show.html.erb
new file mode 100644
index 00000000000..a57319a2026
--- /dev/null
+++ b/app/views/projects/settings/life_cycles/show.html.erb
@@ -0,0 +1,36 @@
+<%#-- 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.
+
+++#%>
+<div data-turbo="true">
+ <%= render Projects::Settings::LifeCycles::ShowPageHeaderComponent.new(project: @project) %>
+
+ <%#= render(Projects::Settings::ProjectCustomFieldSections::IndexComponent.new(
+ project: @project,
+ project_custom_field_sections: @project_custom_field_sections,
+ )) %>
+</div>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index f610a4a04c8..c9af4de7824 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -388,6 +388,10 @@ en:
no_results_content_text: Create a new work package category
custom_fields:
no_results_title_text: There are currently no custom fields available.
+ life_cycle:
+ header:
+ title: "Project lifecycle"
+ description: 'These project stages and gates in the project lifecycle will be displayed in your <a href=%{overview_url} target="_blank">project overview page</a> and are defined in the <a href=%{admin_settings_url} target="_blank">administration settings</a> by the administrator of the instance. You can enable or disable individual attributes.'
project_custom_fields:
header:
title: "Project attributes"
diff --git a/config/routes.rb b/config/routes.rb
index 36339b94060..07707700078 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -519,6 +519,9 @@ Rails.application.routes.draw do
delete :unlink
end
end
+ # TODO: This is for now only added to be able to create a link
+ # There is no controller behind this.
+ resources :project_life_cycles, only: %i[index]
resources :project_custom_field_sections, controller: "/admin/settings/project_custom_field_sections",
only: %i[create update destroy] do
member do