debian-mirror-gitlab/app/views/notify/_note_email.text.erb

34 lines
1.1 KiB
Text
Raw Normal View History

2019-02-15 15:39:39 +05:30
<% note = local_assigns.fetch(:note, @note) -%>
<% diff_limit = local_assigns.fetch(:diff_limit, nil) -%>
2019-07-07 11:18:12 +05:30
<% target_url = local_assigns.fetch(:target_url, @target_url) -%>
2019-02-15 15:39:39 +05:30
<% discussion = note.discussion if note.part_of_discussion? -%>
2017-08-17 22:00:37 +05:30
<% if discussion && !discussion.individual_note? -%>
2019-02-15 15:39:39 +05:30
<%= sanitize_name(note.author_name) -%>
2017-08-17 22:00:37 +05:30
<% if discussion.new_discussion? -%>
<%= " started a new discussion" -%>
<% else -%>
<%= " commented on a discussion" -%>
<% end -%>
<% if discussion.diff_discussion? -%>
<%= " on #{discussion.file_path}" -%>
<% end -%>
<%= ":" -%>
2019-07-07 11:18:12 +05:30
<% if discussion.diff_discussion? || !discussion.new_discussion? -%>
<%= " #{target_url}" -%>
<% end -%>
2017-08-17 22:00:37 +05:30
2018-03-17 18:26:18 +05:30
<% elsif Gitlab::CurrentSettings.email_author_in_body -%>
2019-02-15 15:39:39 +05:30
<%= "#{sanitize_name(note.author_name)} commented:" -%>
2017-08-17 22:00:37 +05:30
<% end -%>
2019-02-15 15:39:39 +05:30
<% if discussion&.diff_discussion? && discussion.on_text? -%>
<% discussion.truncated_diff_lines(highlight: false, diff_limit: diff_limit).each do |line| -%>
2017-08-17 22:00:37 +05:30
<%= "> #{line.text}\n" -%>
<% end -%>
<% end -%>
2019-02-15 15:39:39 +05:30
<%= note.note -%>