File: _note_email.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (39 lines) | stat: -rw-r--r-- 1,524 bytes parent folder | download
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
- 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, "")
- include_stylesheet_link = local_assigns.fetch(:include_stylesheet_link, true)

- author = local_assigns.fetch(:author) { note.author }
- discussion = local_assigns.fetch(:discussion) { note.discussion } if note.part_of_discussion?
- project = local_assigns.fetch(:project, @project)

%p{ style: "color: #777777;" }
  = succeed ':' do
    = link_to author.name, user_url(author)
    - if discussion.nil?
      = link_to 'commented', target_url
    - else
      - if discussion.first_note == note
        started a new
      - else
        commented on a

      - if discussion&.diff_discussion?
        discussion on #{link_to(discussion.file_path, target_url)}
      - else
        = link_to 'discussion', target_url

- if discussion&.diff_discussion? && discussion.on_text? && project.show_diff_preview_in_email?
  - if include_stylesheet_link
    = content_for :head do
      = universal_stylesheet_link_tag 'mailers/highlighted_diff_email'

  %table.code.gl-mb-5
    = render partial: "projects/diffs/email_line",
      collection: discussion.truncated_diff_lines(diff_limit: diff_limit),
      as: :line,
      locals: { diff_file: discussion.diff_file }

.md{ style: note_style }
  = markdown(note.note, pipeline: :email, author: author, current_user: @recipient, issuable_reference_expansion_enabled: true)