gitlab-org--gitlab-foss/app/views/projects/diffs/_content.html.haml

35 lines
1.6 KiB
Text
Raw Normal View History

.diff-content.diff-wrap-lines
2017-01-16 09:57:33 -05:00
-# Skip all non non-supported blobs
- return unless blob.respond_to?(:text?)
- if diff_file.too_large?
.nothing-here-block This diff could not be displayed because it is too large.
- elsif blob.too_large?
.nothing-here-block The file could not be displayed because it is too large.
- elsif blob.readable_text?
- if !project.repository.diffable?(blob)
.nothing-here-block This diff was suppressed by a .gitattributes entry.
- elsif diff_file.collapsed?
- url = url_for(params.merge(action: :diff_for_path, old_path: diff_file.old_path, new_path: diff_file.new_path, file_identifier: diff_file.file_identifier))
.nothing-here-block.diff-collapsed{ data: { diff_for_path: url } }
This diff is collapsed.
%a.click-to-expand
Click to expand it.
- elsif diff_file.diff_lines.length > 0
2017-01-25 15:22:29 -05:00
- total_lines = 0
- if blob.lines.any?
- total_lines = blob.lines.last.chomp == '' ? blob.lines.size - 1 : blob.lines.size
2016-07-21 14:44:12 -04:00
- if diff_view == :parallel
= render "projects/diffs/parallel_view", diff_file: diff_file, total_lines: total_lines
- else
= render "projects/diffs/text_file", diff_file: diff_file, total_lines: total_lines
- else
- if diff_file.mode_changed?
.nothing-here-block File mode changed
- elsif diff_file.renamed_file?
.nothing-here-block File moved
- elsif blob.image?
- old_blob = diff_file.old_blob(diff_file.old_content_commit || @base_commit)
= render "projects/diffs/image", diff_file: diff_file, old_file: old_blob, file: blob
- else
.nothing-here-block No preview for this file type