_text_file.html.haml 1.09 KB
Newer Older
Valeriy Sizov's avatar
Valeriy Sizov committed
1
- too_big = diff.diff.lines.count > 1000
2
- if too_big
3
  %a.supp_diff_link Diff suppressed. Click to show
4

5
%table.text-file{class: "#{'hide' if too_big}"}
6
  - each_diff_line(diff, index) do |line, type, line_code, line_new, line_old, raw_line|
7
    %tr.line_holder{ id: line_code, class: "#{type}" }
8 9 10 11
      - if type == "match"
        %td.old_line= "..."
        %td.new_line= "..."
        %td.line_content.matched= line
12
      - else
13
        %td.old_line
14
          = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code
15
          - if @comments_allowed
16
            = render "projects/notes/diff_note_link", line_code: line_code
17
        %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code
18
        %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line)
19

20 21 22
    - if @reply_allowed
      - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at)
      - unless comments.empty?
23
        = render "projects/notes/diff_notes_with_reply", notes: comments, line: line
24