diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2021-10-03 05:17:18 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2021-10-03 05:17:18 +0000 |
commit | 09618a274bb1f7a1353ff1a8ad4d90fa3efef74c (patch) | |
tree | 92baf6ad80adc3299e17b4cdc88af1513a1eab91 /app/views/settings | |
parent | 01a8167a138a7598a4716e9c04b9d77a50de7491 (diff) | |
download | redmine-09618a274bb1f7a1353ff1a8ad4d90fa3efef74c.tar.gz redmine-09618a274bb1f7a1353ff1a8ad4d90fa3efef74c.zip |
Make hardbreaks behaviour configurable in config/configuration.yml (#32424).
git-svn-id: http://svn.redmine.org/redmine/trunk@21227 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/settings')
-rw-r--r-- | app/views/settings/_general.html.erb | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/app/views/settings/_general.html.erb b/app/views/settings/_general.html.erb index 23abdb3f5..b8d82486a 100644 --- a/app/views/settings/_general.html.erb +++ b/app/views/settings/_general.html.erb @@ -19,7 +19,17 @@ <p><%= setting_select :protocol, [['HTTP', 'http'], ['HTTPS', 'https']] %></p> -<p><%= setting_select :text_formatting, Redmine::WikiFormatting.formats_for_select, :blank => :label_none %></p> +<p><%= setting_select :text_formatting, Redmine::WikiFormatting.formats_for_select, :blank => :label_none %> + <span id="common_mark_info" class="<%= "hidden" unless Setting.text_formatting == "common_mark" %>"> + <label class="block"> + <%= check_box_tag(nil, '', Redmine::Configuration['common_mark_enable_hardbreaks'] === true, disabled: true) %> + Hardbreaks + </label> + <em class="info"> + <%= l(:text_setting_config_change) %> + </em> + </span> +</p> <p><%= setting_check_box :cache_formatted_text %></p> @@ -32,3 +42,16 @@ <%= submit_tag l(:button_save) %> <% end %> + +<%= javascript_tag do %> + $('#settings_text_formatting').on('change', function(e){ + const formatter = e.target.value; + const parent_block = document.getElementById("common_mark_info"); + + if (formatter == "common_mark") { + parent_block.classList.remove('hidden'); + } else { + parent_block.classList.add('hidden'); + } + }); +<% end %> |