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 link pattern page

Henriette Darge3e9a2f486bf3
diff --git a/lookbook/docs/patterns/04-links.md.erb b/lookbook/docs/patterns/04-links.md.erb
new file mode 100644
index 00000000000..857c4c37b35
--- /dev/null
+++ b/lookbook/docs/patterns/04-links.md.erb
@@ -0,0 +1,22 @@
+This document outlines our principles for using HTML links within our application. These guidelines align with our [Primer Design System](https://primer.style/product/components/link/accessibility/#accessibility-and-usability-expectations) to ensure consistency, accessibility, and a user-friendly experience.
+
+# Link Target Behavior
+
+By default, all links **open in the same browser tab**. This maintains user context and supports a seamless navigation experience.
+
+There are **two exceptions** where links may open in a new tab (`target="_blank"`):
+
+* The link points to an **external platform** (e.g., Nextcloud).
+* Opening the link in the same tab would **break the current user flow**, such as during form completion.
+
+When a link opens in a new tab, the following must be implemented:
+
+* An **`aria-label`** must be added to inform screen reader users that the link opens in a new tab (e.g., `"Opens in a new tab"`).
+* The link must be followed by the `link-external` icon to visually indicate that a new tab will open.
+
+# Inline Link Styling
+
+Links that are part of a paragraph or continuous text must be **underlined**. This ensures they are clearly distinguishable from surrounding text, which is especially important for users with color vision deficiencies.
+For links in form captions and PageHeader descriptions, this is done automatically. Other than that, it has to be done [manually](https://primer.style/view-components/lookbook/inspect/primer/beta/link/default) by setting `underline: true`.
+
+<%= embed OpenProject::Common::LinkPreview, :inline %>
diff --git a/lookbook/previews/open_project/common/link_preview.rb b/lookbook/previews/open_project/common/link_preview.rb
new file mode 100644
index 00000000000..314f509ba92
--- /dev/null
+++ b/lookbook/previews/open_project/common/link_preview.rb
@@ -0,0 +1,40 @@
+# 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 OpenProject
+ module Common
+ # @hidden
+ class LinkPreview < Lookbook::Preview
+ def inline
+ render_with_template
+ end
+ end
+ end
+end
diff --git a/lookbook/previews/open_project/common/link_preview/inline.html.erb b/lookbook/previews/open_project/common/link_preview/inline.html.erb
new file mode 100644
index 00000000000..19ea4b02ab5
--- /dev/null
+++ b/lookbook/previews/open_project/common/link_preview/inline.html.erb
@@ -0,0 +1,6 @@
+<%=
+ render(Primer::Beta::Text.new) { "OpenProject is for organizations that want to positively impact the world. We offer project management software that promotes data sovereignty, open source, and collaboration. Our vision is to become the leading project management software for privacy-conscious organizations." }
+%>
+<%=
+ render(Primer::Beta::Link.new(href: "https://www.openproject.org/de/ueber-uns/", underline: true)) { "Learn more." }
+%>