debian-mirror-gitlab/app/views/projects/blob/diff.html.haml

31 lines
1.5 KiB
Text
Raw Normal View History

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|
- line_new = index + @form.since
- line_old = line_new - @form.offset
2016-09-13 17:45:13 +05:30
- line_content = capture do
%td.line_content.noteable_line{ class: line_class }==#{' ' * @form.indent}#{line}
2017-08-17 22:00:37 +05:30
%tr.line_holder.diff-expanded{ id: line_old, class: line_class }
2016-09-13 17:45:13 +05:30
- case diff_view
- when :inline
%td.old_line.diff-line-num{ data: { linenumber: line_old } }
2017-08-17 22:00:37 +05:30
%a{ href: "#", data: { linenumber: line_old }, disabled: true }
2016-09-13 17:45:13 +05:30
%td.new_line.diff-line-num{ data: { linenumber: line_new } }
2017-08-17 22:00:37 +05:30
%a{ href: "#", data: { linenumber: line_new }, disabled: true }
2016-09-13 17:45:13 +05:30
= line_content
- when :parallel
2017-08-17 22:00:37 +05:30
%td.old_line.diff-line-num{ data: { linenumber: line_old } }
%a{ href: "##{line_old}", data: { linenumber: line_old }, disabled: true }
2016-09-13 17:45:13 +05:30
= line_content
2017-08-17 22:00:37 +05:30
%td.new_line.diff-line-num{ data: { linenumber: line_new } }
%a{ href: "##{line_new}", data: { linenumber: line_new }, disabled: true }
2016-09-13 17:45:13 +05:30
= line_content
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