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 description widget

Oliver Günther8971f690de9f
diff --git a/modules/overviews/app/components/overviews/show_component.sass b/modules/overviews/app/components/overviews/show_component.sass
new file mode 100644
index 00000000000..6cf2268529c
--- /dev/null
+++ b/modules/overviews/app/components/overviews/show_component.sass
@@ -0,0 +1,12 @@
+@import 'helpers'
+
+.op-portfolio-overview
+ display: grid
+ grid-template-areas: "description subitems" "description subitems"
+ grid-template-columns: 1fr 1fr
+ grid-template-rows: auto auto auto
+ gap: 1rem
+
+ @media only screen and (max-width: $breakpoint-xl)
+ grid-template-areas: "description" "subitems"
+ grid-template-columns: 1fr
diff --git a/modules/overviews/app/components/overviews/widgets/description_component.html.erb b/modules/overviews/app/components/overviews/widgets/description_component.html.erb
new file mode 100644
index 00000000000..8157058ac90
--- /dev/null
+++ b/modules/overviews/app/components/overviews/widgets/description_component.html.erb
@@ -0,0 +1,43 @@
+<%#-- 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.
+
+++#%>
+
+<%=
+ component_wrapper do
+ render(Primer::Beta::BorderBox.new) do |component|
+ component.with_header do
+ render(Primer::Beta::Text.new) { Project.human_attribute_name(:description) }
+ end
+
+ component.with_row do
+ helpers.format_text project, :description
+ end
+ end
+ end
+%>
diff --git a/modules/overviews/app/components/overviews/widgets/description_component.rb b/modules/overviews/app/components/overviews/widgets/description_component.rb
new file mode 100644
index 00000000000..9fc7cd26fc9
--- /dev/null
+++ b/modules/overviews/app/components/overviews/widgets/description_component.rb
@@ -0,0 +1,43 @@
+# frozen_string_literal: true
+
+# -- 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.
+# ++
+
+module Overviews
+ module Widgets
+ class DescriptionComponent < ApplicationComponent
+ include OpTurbo::Streamable
+ include OpPrimer::ComponentHelpers
+ include ApplicationHelper
+
+ def project = model
+
+ delegate :description, to: :project
+ end
+ end
+end