summaryrefslogtreecommitdiff
path: root/app/views/notify/_note_email.text.erb
blob: 8e2f7e6f76ef40d09c14e69bfd4d4b55b7dd4815 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<% 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? -%>

<%= sanitize_name(note.author_name) -%>
<%  if discussion.nil? -%>
 <%= 'commented' -%>:
<%  else -%>
<%    if note.start_of_discussion? -%>
 <%=    'started a new discussion' -%>
<%    else -%>
 <%=    'commented on a discussion' -%>
<%    end -%>
<%    if discussion.diff_discussion? -%>
 <%=    "on #{discussion.file_path}" -%>
<%    end -%>
<%=   ':' -%>
<%=   " #{target_url}" -%>
<%  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 -%>