gitlab-org--gitlab-foss/app/views/projects/diffs/_line.html.haml
Douwe Maan 5a8f727fd5 Merge branch 'master' into faster-diffs
# Conflicts:
#	app/helpers/notes_helper.rb
#	app/views/projects/diffs/_line.html.haml
#	app/views/projects/diffs/_parallel_view.html.haml
#	app/views/projects/diffs/_text_file.html.haml
#	features/steps/shared/diff_note.rb
2016-07-07 18:05:34 -04:00

27 lines
1.1 KiB
Text

- plain = local_assigns.fetch(:plain, false)
- line_code = diff_file.line_code(line)
- position = diff_file.position(line)
- type = line.type
%tr.line_holder{ id: line_code, class: type }
- case type
- when 'match'
= render "projects/diffs/match_line", { line: line.text,
line_old: line.old_pos, line_new: line.new_pos, bottom: false, new_file: diff_file.new_file }
- when 'nonewline'
%td.old_line.diff-line-num
%td.new_line.diff-line-num
%td.line_content.match= line.text
- else
%td.old_line.diff-line-num{ class: type, data: { linenumber: line.old_pos } }
- link_text = type == "new" ? " " : line.old_pos
- if plain
= link_text
- else
%a{href: "##{line_code}", data: { linenumber: link_text }}
%td.new_line.diff-line-num{ class: type, data: { linenumber: line.new_pos } }
- link_text = type == "old" ? " " : line.new_pos
- if plain
= link_text
- else
%a{href: "##{line_code}", data: { linenumber: link_text }}
%td.line_content.noteable_line{ class: type, data: (diff_view_line_data(line_code, position, type) unless plain) }= diff_line_content(line.text, type)