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

_text_file.html.haml « commits « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1456257ce3daa8c71a4c5b1e4395d6565f3ef2f0 (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
%table
  - line_old = 0
  - line_new = 0
  - diff_str = diff.diff
  - lines_arr = diff_str.lines.to_a
  - lines_arr.each do |line|
    - next if line.match(/^--- \/dev\/null/)
    - next if line.match(/^--- a/)
    - next if line.match(/^\+\+\+ b/)
    - if line.match(/^@@ -/)
      - line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0
      - line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0
      %tr.line_holder
        %td.old_line= "..."
        %td.new_line= "..."
        %td.line_content  
      - next

    - full_line = html_escape(line.gsub(/\n/, ''))
    %tr.line_holder
      %td.old_line
        = link_to raw(diff_line_class(line) == "new" ? " " : line_old), "#OLD#{index}-#{line_old}", :id => "OLD#{index}-#{line_old}"
      %td.new_line
        = link_to raw(diff_line_class(line) == "old" ? " " : line_new) , "#NEW#{index}-#{line_new}", :id => "NEW#{index}-#{line_new}"
      %td.line_content{:class => "#{diff_line_class(full_line)} #{build_line_code(line, index, line_new, line_old)}", "line_code" => build_line_code(line, index, line_new, line_old)}= raw "#{full_line}  "
    - comments = @line_notes.select { |n| n.for_line?(index, line_old, line_new) }.sort_by(&:created_at).reverse
    - unless comments.empty?
      - comments.each do |note|
        = render "notes/per_line_show", :note => note
    - if line[0] == "+"
      - line_new += 1
    - elsif line[0] == "-"
      - line_old += 1
    - else
      - line_new += 1
      - line_old += 1