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))
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 = {}
<% 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 %>
</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' %>
<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 %>
</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">
setting_attachment_extensions_allowed: Allowed extensions
setting_attachment_extensions_denied: Disallowed extensions
setting_new_item_menu_tab: Project menu tab for creating new objects
+ setting_commit_logs_formatting: Apply text formatting to commit messages
permission_add_project: Create project
permission_add_subprojects: Create subprojects
setting_sys_api_key: Clé de protection de l'API
setting_lost_password: Autoriser la réinitialisation par email de mot de passe perdu
setting_new_item_menu_tab: Onglet de création d'objets dans le menu du project
+ setting_commit_logs_formatting: Appliquer le formattage de texte aux messages de commit
permission_add_project: Créer un projet
permission_add_subprojects: Créer des sous-projets
# encoding used to convert commit logs to UTF-8
commit_logs_encoding:
default: 'UTF-8'
+commit_logs_formatting:
+ default: 1
repository_log_display_limit:
format: int
default: 100
div#issue-changesets div.changeset { padding: 4px;}
div#issue-changesets div.changeset { border-bottom: 1px solid #ddd; }
div#issue-changesets p { margin-top: 0; margin-bottom: 1em;}
+.changset-comments {margin-bottom:1em; font-family:}
div.journal {overflow:auto;}
div.journal.private-notes {border-left:2px solid #d22; padding-left:4px; margin-left:-6px;}
assert_select 'h2', :text => 'Revision 1'
end
+ def test_revision_should_not_format_comments_when_disabled
+ Changeset.where(:id => 100).update_all(:comments => 'Simple *text*')
+
+ with_settings :commit_logs_formatting => '0' do
+ get :revision, :id => 1, :rev => 1
+ assert_response :success
+ assert_select '.changset-comments', :text => 'Simple *text*'
+ end
+ end
+
def test_revision_should_show_add_related_issue_form
Role.find(1).add_permission! :manage_related_issues
@request.session[:user_id] = 2