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

put consent checkbox label in helper; support markdown

Markus Kahl5b013f2d466b
diff --git a/app/assets/stylesheets/content/_forms.sass b/app/assets/stylesheets/content/_forms.sass
index 993d0c81b35..0ddcf7815d7 100644
--- a/app/assets/stylesheets/content/_forms.sass
+++ b/app/assets/stylesheets/content/_forms.sass
@@ -268,7 +268,7 @@ fieldset.form--fieldset
font-size: 1rem
font-style: italic
line-height: 1.8
-
+
a:hover
text-decoration: none
@@ -409,7 +409,7 @@ fieldset.form--fieldset
&.-vertical
display: block
-
+
.form--field.-visible-overflow &
overflow: visible
@@ -792,6 +792,9 @@ input[readonly].-clickable
line-height: $base-line-height
padding: 0 2rem 0 0
+ > p
+ display: inline
+
&:not(.-no-ellipsis)
@include text-shortener
diff --git a/app/helpers/user_consent_helper.rb b/app/helpers/user_consent_helper.rb
index f7aaa07de5f..54709041530 100644
--- a/app/helpers/user_consent_helper.rb
+++ b/app/helpers/user_consent_helper.rb
@@ -51,6 +51,10 @@ module ::UserConsentHelper
all.fetch(locale) { all.values.first }
end
+ def consent_checkbox_label(locale: I18n.locale)
+ format_text I18n.t('consent.checkbox_label', locale: locale)
+ end
+
def consent_configured?
if Setting.consent_info.count == 0
Rails.logger.error 'Instance is configured to require consent, but no consent_info has been set.'
diff --git a/app/views/account/_user_consent_check.html.erb b/app/views/account/_user_consent_check.html.erb
index 9d7519588ba..e6bad96aba8 100644
--- a/app/views/account/_user_consent_check.html.erb
+++ b/app/views/account/_user_consent_check.html.erb
@@ -8,6 +8,6 @@
<input type="checkbox" name="consent_check" class="form--check-box" required="required" />
</div>
- <%= t('consent.checkbox_label') %>
+ <%= consent_checkbox_label %>
</label>
</section>
diff --git a/lib/open_project/text_formatting/renderer.rb b/lib/open_project/text_formatting/renderer.rb
index c43e33c12b1..cad8d8100a9 100644
--- a/lib/open_project/text_formatting/renderer.rb
+++ b/lib/open_project/text_formatting/renderer.rb
@@ -34,16 +34,18 @@ module OpenProject::TextFormatting
def format_text(text, options = {})
return '' if text.blank?
- formatter = if options.delete(:plain)
- OpenProject::TextFormatting::Formats.plain_formatter
- else
- OpenProject::TextFormatting::Formats.rich_formatter
- end
-
- formatter
+ formatter(plain: options.delete(:plain))
.new(options)
.to_html(text)
end
+
+ def formatter(plain: false)
+ if plain
+ OpenProject::TextFormatting::Formats.plain_formatter
+ else
+ OpenProject::TextFormatting::Formats.rich_formatter
+ end
+ end
end
end
end