gitlab-org--gitlab-foss/app/views/projects/edit_tree/preview.html.haml
Dmitriy Zaporozhets 531f16beb0
Use new diff parsing logic
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-08 16:27:12 +03:00

26 lines
1.1 KiB
Text

.diff-file
.diff-content
- if gitlab_markdown?(@blob.name)
.file-content.wiki
= preserve do
= markdown(@content)
- elsif markup?(@blob.name)
.file-content.wiki
= raw render_markup(@blob.name, @content)
- else
.file-content.code
- unless @diff_lines.empty?
%table.text-file
- @diff_lines.each do |line|
%tr.line_holder{ id: line.code, class: "#{line.type}" }
- if line.type == "match"
%td.old_line= "..."
%td.new_line= "..."
%td.line_content.matched= line.text
- else
%td.old_line
= link_to raw(line.type == "new" ? "&nbsp;" : line.old_pos), "##{line.code}", id: line.code
%td.new_line= link_to raw(line.type == "old" ? "&nbsp;" : line.new_pos) , "##{line.code}", id: line.code
%td.line_content{class: "noteable_line #{line.type} #{line.code}", "line.code" => line.code}= raw diff_line_content(line.text)
- else
.nothing-here-block No changes.