BigW Consortium Gitlab

diff.html.haml 1.5 KB
Newer Older
skv committed
1
- if @lines.present?
2
  - line_class = diff_view == :inline ? '' : diff_view
skv committed
3
  - if @form.unfold? && @form.since != 1 && !@form.bottom?
4 5
    %tr.line_holder{ class: line_class }
      = diff_match_line @form.since, @form.since, text: @match_line, view: diff_view
skv committed
6 7 8 9

  - @lines.each_with_index do |line, index|
    - line_new = index + @form.since
    - line_old = line_new - @form.offset
10 11
    - line_content = capture do
      %td.line_content.noteable_line{ class: line_class }==#{' ' * @form.indent}#{line}
12
    %tr.line_holder.diff-expanded{ id: line_old, class: line_class }
13 14 15
      - case diff_view
      - when :inline
        %td.old_line.diff-line-num{ data: { linenumber: line_old } }
16
          %a{ href: "#", data: { linenumber: line_old }, disabled: true }
17
        %td.new_line.diff-line-num{ data: { linenumber: line_new } }
18
          %a{ href: "#", data: { linenumber: line_new }, disabled: true }
19 20
        = line_content
      - when :parallel
21
        %td.old_line.diff-line-num{ data: { linenumber: line_old } }
22
          %a{ href: "##{line_old}", data: { linenumber: line_old }, disabled: true }
23
        = line_content
24
        %td.new_line.diff-line-num{ data: { linenumber: line_new } }
25
          %a{ href: "##{line_new}", data: { linenumber: line_new }, disabled: true }
26
        = line_content
skv committed
27

28
  - if @form.unfold? && @form.bottom? && @form.to < @blob.lines.size
29
    %tr.line_holder{ id: @form.to, class: line_class }
30
      = diff_match_line @form.to - @form.offset, @form.to, text: @match_line, view: diff_view, bottom: true