diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-07-07 18:05:34 -0400 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-07 18:05:34 -0400 |
commit | 5a8f727fd5400634a99eae82e7bac5e26cf36d4e (patch) | |
tree | dde30050a8992e4ba0b5d3f0e98794d1f6089df8 /app/views/projects/diffs/_line.html.haml | |
parent | d925aea9f388f8ca5c858e825e5303232fa16c1d (diff) | |
parent | 86d238e4bda6424a79eb9d8ea7cfe41af714f49f (diff) | |
download | gitlab-ce-5a8f727fd5400634a99eae82e7bac5e26cf36d4e.tar.gz |
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
Diffstat (limited to 'app/views/projects/diffs/_line.html.haml')
-rw-r--r-- | app/views/projects/diffs/_line.html.haml | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/views/projects/diffs/_line.html.haml b/app/views/projects/diffs/_line.html.haml index 1953720b79e..5a8a131d10c 100644 --- a/app/views/projects/diffs/_line.html.haml +++ b/app/views/projects/diffs/_line.html.haml @@ -1,6 +1,8 @@ +- plain = local_assigns.fetch(:plain, false) +- line_code = diff_file.line_code(line) +- position = diff_file.position(line) - type = line.type -- line_data = @diff_notes_disabled ? {} : { data: { discussion_id: discussion_id(line_code) } } -%tr.line_holder{ line_data, id: line_code, class: type } +%tr.line_holder{ id: line_code, class: type } - case type - when 'match' = render "projects/diffs/match_line", { line: line.text, @@ -10,16 +12,16 @@ %td.new_line.diff-line-num %td.line_content.match= line.text - else - %td.old_line.diff-line-num{ class: type, data: { linenumber: line.new_pos } } + %td.old_line.diff-line-num{ class: type, data: { linenumber: line.old_pos } } - link_text = type == "new" ? " " : line.old_pos - - if defined?(plain) && plain + - 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 defined?(plain) && plain + - if plain = link_text - else %a{href: "##{line_code}", data: { linenumber: link_text }} - %td.line_content{ class: ['noteable_line', type], data: { line_code: line_code, line_type: type } }= diff_line_content(line.text, type) + %td.line_content.noteable_line{ class: type, data: (diff_view_line_data(line_code, position, type) unless plain) }= diff_line_content(line.text, type) |