Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_note_email.html.haml « notify « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1fbae2f64ed7c6c37bac0f182b3aeba80f703f77 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
- note = local_assigns.fetch(:note, @note)
- diff_limit = local_assigns.fetch(:diff_limit, nil)
- target_url = local_assigns.fetch(:target_url, @target_url)
- note_style = local_assigns.fetch(:note_style, "")

- discussion = note.discussion if note.part_of_discussion?
- diff_discussion = discussion&.diff_discussion?
- on_image = discussion.on_image? if diff_discussion

- if discussion
  - phrase_end_char = on_image ? "." : ":"

  %p{ style: "color: #777777;" }
    = succeed phrase_end_char do
      = link_to note.author_name, user_url(note.author)

      - if diff_discussion
        - if discussion.new_discussion?
          started a new discussion
        - else
          commented on a discussion

        on #{link_to discussion.file_path, target_url}
      - else
        - if discussion.new_discussion?
          started a new discussion
        - else
          commented on a #{link_to 'discussion', target_url}

- elsif Gitlab::CurrentSettings.email_author_in_body
  %p.details
    #{link_to note.author_name, user_url(note.author)} commented:

- if diff_discussion && !on_image
  = content_for :head do
    = stylesheet_link_tag 'mailers/highlighted_diff_email'

  %table
    = render partial: "projects/diffs/line",
      collection: discussion.truncated_diff_lines(diff_limit: diff_limit),
      as: :line,
      locals: { diff_file: discussion.diff_file,
        plain: true,
        email: true }

%div{ style: note_style }
  = markdown(note.note, pipeline: :email, author: note.author)