2014-09-02 18:07:02 +05:30
|
|
|
- if @lines.present?
|
2016-09-13 17:45:13 +05:30
|
|
|
- line_class = diff_view == :inline ? '' : diff_view
|
2014-09-02 18:07:02 +05:30
|
|
|
- if @form.unfold? && @form.since != 1 && !@form.bottom?
|
2016-09-13 17:45:13 +05:30
|
|
|
%tr.line_holder{ class: line_class }
|
|
|
|
= diff_match_line @form.since, @form.since, text: @match_line, view: diff_view
|
2014-09-02 18:07:02 +05:30
|
|
|
|
|
|
|
- @lines.each_with_index do |line, index|
|
2018-03-17 18:26:18 +05:30
|
|
|
- line_number_new = index + @form.since
|
|
|
|
- line_number_old = line_number_new - @form.offset
|
|
|
|
- line[0, 0] = ' ' * @form.indent
|
|
|
|
%tr.line_holder.diff-expanded{ id: line_number_old, class: line_class }
|
2016-09-13 17:45:13 +05:30
|
|
|
- case diff_view
|
|
|
|
- when :inline
|
2018-03-17 18:26:18 +05:30
|
|
|
%td.old_line.diff-line-num{ data: { linenumber: line_number_old } }
|
|
|
|
%a{ href: "#", data: { linenumber: line_number_old }, disabled: true }
|
|
|
|
%td.new_line.diff-line-num{ data: { linenumber: line_number_new } }
|
|
|
|
%a{ href: "#", data: { linenumber: line_number_new }, disabled: true }
|
2019-05-30 16:15:17 +05:30
|
|
|
%td.line_content.noteable_line{ class: line_class }= line
|
2016-09-13 17:45:13 +05:30
|
|
|
- when :parallel
|
2018-03-17 18:26:18 +05:30
|
|
|
%td.old_line.diff-line-num{ data: { linenumber: line_number_old } }
|
|
|
|
%a{ href: "##{line_number_old}", data: { linenumber: line_number_old }, disabled: true }
|
2019-05-30 16:15:17 +05:30
|
|
|
%td.line_content.noteable_line.left-side{ class: line_class }= line
|
2018-03-17 18:26:18 +05:30
|
|
|
%td.new_line.diff-line-num{ data: { linenumber: line_number_new } }
|
|
|
|
%a{ href: "##{line_number_new}", data: { linenumber: line_number_new }, disabled: true }
|
2019-05-30 16:15:17 +05:30
|
|
|
%td.line_content.noteable_line.right-side{ class: line_class }= line
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
- if @form.unfold? && @form.bottom? && @form.to < @blob.lines.size
|
2016-09-13 17:45:13 +05:30
|
|
|
%tr.line_holder{ id: @form.to, class: line_class }
|
2017-08-17 22:00:37 +05:30
|
|
|
= diff_match_line @form.to - @form.offset, @form.to, text: @match_line, view: diff_view, bottom: true
|