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 to documentation for supported attributes

Jan Sandbrink44bdb430ffec
diff --git a/app/forms/work_packages/types/subject_configuration_form.rb b/app/forms/work_packages/types/subject_configuration_form.rb
index 7f6b1697552..9a6897c98e6 100644
--- a/app/forms/work_packages/types/subject_configuration_form.rb
+++ b/app/forms/work_packages/types/subject_configuration_form.rb
@@ -56,7 +56,7 @@ module WorkPackages
value: model.pattern,
suggestions: model.suggestions,
label: I18n.t("types.edit.subject_configuration.pattern.label"),
- caption: I18n.t("types.edit.subject_configuration.pattern.caption"),
+ caption: pattern_input_caption,
required: true,
validation_message: validation_message_for(:patterns)
)
@@ -82,6 +82,20 @@ module WorkPackages
def validation_message_for(attribute)
model.validation_errors.messages_for(attribute).to_sentence.presence
end
+
+ def pattern_input_caption
+ I18n.t(
+ "types.edit.subject_configuration.pattern.caption_with_supported_attributes_link",
+ link: make_link(
+ ::OpenProject::Static::Links.url_for(:enterprise_features, :work_package_subject_generation),
+ I18n.t("types.edit.subject_configuration.pattern.supported_attributes_link")
+ )
+ ).html_safe
+ end
+
+ def make_link(href, link_text)
+ render(Primer::Beta::Link.new(href:, target: "_blank")) { link_text }
+ end
end
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index eeb1d35a0f9..0407e0e6a48 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -695,8 +695,9 @@ en:
project: "Project"
pattern:
label: "Subject pattern"
- caption: "Add text or type / to search for an attribute. You can add spaces to separate them."
+ caption_with_supported_attributes_link: Create patterns by adding text, or type "/" to search for %{link}.
insert_as_text: "No attributes found. Add as text: \"%{word}\""
+ supported_attributes_link: "supported attributes"
export_configuration:
tab: "Generate PDF"
intro: "Select which templates from those that are available you would like to enable for this type. The template determines the design and attributes visible in the exported PDF of a work package using this type. The first template on the list is selected by default."