BigW Consortium Gitlab

_line.html.haml 1.23 KB
Newer Older
1
- type = line.type
2
%tr.line_holder{ id: line_code, class: type }
3 4
  - case type
  - when 'match'
5 6
    = render "projects/diffs/match_line", { line: line.text,
      line_old: line.old_pos, line_new: line.new_pos, bottom: false, new_file: diff_file.new_file }
7 8 9 10 11
  - when 'nonewline'
    %td.old_line.diff-line-num
    %td.new_line.diff-line-num
    %td.line_content.match= line.text
  - else
12 13
    %td.old_line.diff-line-num{ class: type, data: { linenumber: line.new_pos } }
      - link_text = type == "new" ? " ".html_safe : line.old_pos
14 15 16
      - if defined?(plain) && plain
        = link_text
      - else
17
        = link_to "", "##{line_code}", id: line_code, data: { linenumber: link_text }
18
      - if !@diff_notes_disabled && can?(current_user, :create_note, @project)
19
        = link_to_new_diff_note(line_code)
20 21
    %td.new_line.diff-line-num{ class: type, data: { linenumber: line.new_pos } }
      - link_text = type == "old" ? " ".html_safe : line.new_pos
22 23 24
      - if defined?(plain) && plain
        = link_text
      - else
25
        = link_to "", "##{line_code}", id: line_code, data: { linenumber: link_text }
26
    %td.line_content{ class: ['noteable_line', type, line_code], data: { line_code: line_code } }= diff_line_content(line.text, type)