diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-12 21:19:59 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-12 21:19:59 +0000 |
commit | ba2a47a8fb755a88914702d129bb6a727e45691a (patch) | |
tree | 9c2b682c14d2167a3fc4bf066952272d5347da81 /app | |
parent | f3068cd37a2db2bc2778d69b82921c2fbd5c2d07 (diff) | |
download | redmine-ba2a47a8fb755a88914702d129bb6a727e45691a.tar.gz redmine-ba2a47a8fb755a88914702d129bb6a727e45691a.zip |
Adds a setting to enable/disable formatting of commit messages (#22758).
git-svn-id: http://svn.redmine.org/redmine/trunk@16062 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/application_helper.rb | 13 | ||||
-rw-r--r-- | app/views/issues/_changesets.html.erb | 4 | ||||
-rw-r--r-- | app/views/repositories/_changeset.html.erb | 4 | ||||
-rw-r--r-- | app/views/repositories/_revisions.html.erb | 2 | ||||
-rw-r--r-- | app/views/settings/_repositories.html.erb | 2 |
5 files changed, 20 insertions, 5 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d4bd6a2f2..e6078358d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -254,6 +254,11 @@ module ApplicationHelper end end + def format_changeset_comments(changeset, options={}) + method = options[:short] ? :short_comments : :comments + textilizable changeset, method, :formatting => Setting.commit_logs_formatting? + end + def due_date_distance_in_words(date) if date l((date < User.current.today ? :label_roadmap_overdue : :label_roadmap_due_in), distance_of_date_in_words(User.current.today, date)) @@ -619,7 +624,13 @@ module ApplicationHelper text = text.dup macros = catch_macros(text) - text = Redmine::WikiFormatting.to_html(Setting.text_formatting, text, :object => obj, :attribute => attr) + + if options[:formatting] == false + text = h(text) + else + formatting = options[:formatting] || Setting.text_formatting + text = Redmine::WikiFormatting.to_html(formatting, text, :object => obj, :attribute => attr) + end @parsed_headings = [] @heading_anchors = {} diff --git a/app/views/issues/_changesets.html.erb b/app/views/issues/_changesets.html.erb index f4b47c617..0e963fcf8 100644 --- a/app/views/issues/_changesets.html.erb +++ b/app/views/issues/_changesets.html.erb @@ -13,8 +13,8 @@ <% end %> <br /> <span class="author"><%= authoring(changeset.committed_on, changeset.author) %></span></p> - <div class="wiki"> - <%= textilizable(changeset, :comments) %> + <div class="wiki changset-comments"> + <%= format_changeset_comments changeset %> </div> </div> <% end %> diff --git a/app/views/repositories/_changeset.html.erb b/app/views/repositories/_changeset.html.erb index dbdf17160..e123daf86 100644 --- a/app/views/repositories/_changeset.html.erb +++ b/app/views/repositories/_changeset.html.erb @@ -33,7 +33,9 @@ </div> -<%= textilizable @changeset.comments %> +<div class="wiki changset-comments"> + <%= format_changeset_comments @changeset %> +</div> <% if @changeset.issues.visible.any? || User.current.allowed_to?(:manage_related_issues, @repository.project) %> <%= render :partial => 'related_issues' %> diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb index 9c72204fa..d1b9c4b04 100644 --- a/app/views/repositories/_revisions.html.erb +++ b/app/views/repositories/_revisions.html.erb @@ -42,7 +42,7 @@ end %> <td class="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').prop('checked')) {$('#cb-#{line_num-1}').prop('checked',true);}") if show_diff && (line_num > 1) %></td> <td class="committed_on"><%= format_time(changeset.committed_on) %></td> <td class="author"><%= changeset.user.blank? ? changeset.author.to_s.truncate(30) : link_to_user(changeset.user) %></td> -<td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td> +<td class="comments"><%= format_changeset_comments changeset, :short => true %></td> </tr> <% line_num += 1 %> <% end %> diff --git a/app/views/settings/_repositories.html.erb b/app/views/settings/_repositories.html.erb index 760903ea0..adac52fc7 100644 --- a/app/views/settings/_repositories.html.erb +++ b/app/views/settings/_repositories.html.erb @@ -52,6 +52,8 @@ </p> <p><%= setting_text_field :repository_log_display_limit, :size => 6 %></p> + +<p><%= setting_check_box :commit_logs_formatting %></p> </div> <fieldset class="box tabular settings"> |