gitlab-org--gitlab-foss/app/views/notify/_note_email.text.erb
Mark Chao 3712bb4a05 Display link to review note in text email
similar with HTML email
2019-03-28 14:16:50 +08:00

33 lines
1.1 KiB
Text

<% note = local_assigns.fetch(:note, @note) -%>
<% diff_limit = local_assigns.fetch(:diff_limit, nil) -%>
<% target_url = local_assigns.fetch(:target_url, @target_url) -%>
<% discussion = note.discussion if note.part_of_discussion? -%>
<% if discussion && !discussion.individual_note? -%>
<%= sanitize_name(note.author_name) -%>
<% if discussion.new_discussion? -%>
<%= " started a new discussion" -%>
<% else -%>
<%= " commented on a discussion" -%>
<% end -%>
<% if discussion.diff_discussion? -%>
<%= " on #{discussion.file_path}" -%>
<% end -%>
<%= ":" -%>
<% if discussion.diff_discussion? || !discussion.new_discussion? -%>
<%= " #{target_url}" -%>
<% end -%>
<% elsif Gitlab::CurrentSettings.email_author_in_body -%>
<%= "#{sanitize_name(note.author_name)} commented:" -%>
<% end -%>
<% if discussion&.diff_discussion? && discussion.on_text? -%>
<% discussion.truncated_diff_lines(highlight: false, diff_limit: diff_limit).each do |line| -%>
<%= "> #{line.text}\n" -%>
<% end -%>
<% end -%>
<%= note.note -%>