_text_file.html.haml 1.1 KB
Newer Older
V
Valeriy Sizov 已提交
1
- too_big = diff.diff.lines.count > 1000
2
- if too_big
R
randx 已提交
3
  %a.supp_diff_link Diff suppressed. Click to show
4

5
%table{class: "#{'hide' if too_big}"}
6
  - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old|
7
    %tr.line_holder{ id: line_code }
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 "notes/per_line_note_link", line_code: line_code
17 18
        %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code
        %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line}  "
19

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