diff options
Diffstat (limited to 'app/views/projects/diffs')
-rw-r--r-- | app/views/projects/diffs/_diffs.html.haml | 23 | ||||
-rw-r--r-- | app/views/projects/diffs/_file.html.haml | 50 | ||||
-rw-r--r-- | app/views/projects/diffs/_image.html.haml | 64 | ||||
-rw-r--r-- | app/views/projects/diffs/_match_line.html.haml | 7 | ||||
-rw-r--r-- | app/views/projects/diffs/_match_line_parallel.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/diffs/_parallel_view.html.haml | 41 | ||||
-rw-r--r-- | app/views/projects/diffs/_stats.html.haml | 38 | ||||
-rw-r--r-- | app/views/projects/diffs/_text_file.html.haml | 36 | ||||
-rw-r--r-- | app/views/projects/diffs/_warning.html.haml | 19 |
9 files changed, 0 insertions, 282 deletions
diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml deleted file mode 100644 index b49aee504fe..00000000000 --- a/app/views/projects/diffs/_diffs.html.haml +++ /dev/null @@ -1,23 +0,0 @@ -.prepend-top-20.append-bottom-20 - .pull-right - .btn-group - = inline_diff_btn - = parallel_diff_btn - = render 'projects/diffs/stats', diffs: diffs - -- if show_diff_size_warning?(diffs) - = render 'projects/diffs/warning', diffs: diffs - -.files - - safe_diff_files(diffs).each_with_index do |diff_file, index| - = render 'projects/diffs/file', diff_file: diff_file, i: index, project: project - -- if @diff_timeout - .alert.alert-danger - %h4 - Failed to collect changes - %p - Maybe diff is really big and operation failed with timeout. Try to get diff locally - -:coffeescript - $('.files .diff-header').stick_in_parent(offset_top: $('.navbar').height()) diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml deleted file mode 100644 index 672a6635321..00000000000 --- a/app/views/projects/diffs/_file.html.haml +++ /dev/null @@ -1,50 +0,0 @@ -- blob = project.repository.blob_for_diff(@commit, diff_file.diff) -- return unless blob -- blob_diff_path = namespace_project_blob_diff_path(project.namespace, project, tree_join(@commit.id, diff_file.file_path)) -.diff-file{id: "diff-#{i}", data: {blob_diff_path: blob_diff_path }} - .diff-header{id: "file-path-#{hexdigest(diff_file.new_path || diff_file.old_path)}"} - - if diff_file.deleted_file - %span="#{diff_file.old_path} deleted" - - .diff-btn-group - - if @commit.parent_ids.present? - = view_file_btn(@commit.parent_id, diff_file, project) - - elsif diff_file.diff.submodule? - - submodule_item = project.repository.blob_at(@commit.id, diff_file.file_path) - = submodule_link(submodule_item, @commit.id) - - else - %span - - if diff_file.renamed_file - = "#{diff_file.old_path} renamed to #{diff_file.new_path}" - - else - = diff_file.new_path - - if diff_file.mode_changed? - %span.file-mode= "#{diff_file.diff.a_mode} → #{diff_file.diff.b_mode}" - - .diff-btn-group - - if blob.text? - = link_to '#', class: 'js-toggle-diff-comments btn btn-sm active has_tooltip', title: "Toggle comments for this file" do - %i.fa.fa-comments - - - - if @merge_request && @merge_request.source_project - = edit_blob_link(@merge_request.source_project, - @merge_request.source_branch, diff_file.new_path, - after: ' ', from_merge_request_id: @merge_request.id) - - = view_file_btn(@commit.id, diff_file, project) - - .diff-content.diff-wrap-lines - -# Skipp all non non-supported blobs - - return unless blob.respond_to?('text?') - - if blob.text? - - if params[:view] == 'parallel' - = render "projects/diffs/parallel_view", diff_file: diff_file, project: project, blob: blob, index: i - - else - = render "projects/diffs/text_file", diff_file: diff_file, index: i - - elsif blob.image? - - old_file = project.repository.prev_blob_for_diff(@commit, diff_file) - = render "projects/diffs/image", diff_file: diff_file, old_file: old_file, file: blob, index: i - - else - .nothing-here-block No preview for this file type - diff --git a/app/views/projects/diffs/_image.html.haml b/app/views/projects/diffs/_image.html.haml deleted file mode 100644 index 058b71b21f5..00000000000 --- a/app/views/projects/diffs/_image.html.haml +++ /dev/null @@ -1,64 +0,0 @@ -- diff = diff_file.diff -- if diff.renamed_file || diff.new_file || diff.deleted_file - .image - %span.wrap - .frame{class: image_diff_class(diff)} - %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} - %p.image-info= "#{number_to_human_size file.size}" -- else - .image - %div.two-up.view - %span.wrap - .frame.deleted - %a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(@commit.parent_id, diff.old_path))} - %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"} - %p.image-info.hide - %span.meta-filesize= "#{number_to_human_size old_file.size}" - | - %b W: - %span.meta-width - | - %b H: - %span.meta-height - %span.wrap - .frame.added - %a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(@commit.id, diff.new_path))} - %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} - %p.image-info.hide - %span.meta-filesize= "#{number_to_human_size file.size}" - | - %b W: - %span.meta-width - | - %b H: - %span.meta-height - - %div.swipe.view.hide - .swipe-frame - .frame.deleted - %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"} - .swipe-wrap - .frame.added - %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} - %span.swipe-bar - %span.top-handle - %span.bottom-handle - - %div.onion-skin.view.hide - .onion-skin-frame - .frame.deleted - %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"} - .frame.added - %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} - .controls - .transparent - .drag-track - .dragger{:style => "left: 0px;"} - .opaque - - - .view-modes.hide - %ul.view-modes-menu - %li.two-up{data: {mode: 'two-up'}} 2-up - %li.swipe{data: {mode: 'swipe'}} Swipe - %li.onion-skin{data: {mode: 'onion-skin'}} Onion skin diff --git a/app/views/projects/diffs/_match_line.html.haml b/app/views/projects/diffs/_match_line.html.haml deleted file mode 100644 index 4ebe3379733..00000000000 --- a/app/views/projects/diffs/_match_line.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -%td.old_line.diff-line-num.unfold.js-unfold{data: {linenumber: line_old}, - class: unfold_bottom_class(bottom)} - \... -%td.new_line.diff-line-num.unfold.js-unfold{data: {linenumber: line_new}, - class: unfold_bottom_class(bottom)} - \... -%td.line_content.matched= line diff --git a/app/views/projects/diffs/_match_line_parallel.html.haml b/app/views/projects/diffs/_match_line_parallel.html.haml deleted file mode 100644 index 815df16aa4a..00000000000 --- a/app/views/projects/diffs/_match_line_parallel.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%td.old_line - %td.line_content.parallel.matched= line -%td.new_line - %td.line_content.parallel.matched= line diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml deleted file mode 100644 index 75f3a80f0d7..00000000000 --- a/app/views/projects/diffs/_parallel_view.html.haml +++ /dev/null @@ -1,41 +0,0 @@ -/ Side-by-side diff view -%div.text-file.diff-wrap-lines - %table - - parallel_diff(diff_file, index).each do |line| - - type_left = line[0] - - line_number_left = line[1] - - line_content_left = line[2] - - line_code_left = line[3] - - type_right = line[4] - - line_number_right = line[5] - - line_content_right = line[6] - - line_code_right = line[7] - - %tr.line_holder.parallel - - if type_left == 'match' - = render "projects/diffs/match_line_parallel", { line: line_content_left, - line_old: line_number_left, line_new: line_number_right } - - elsif type_left == 'old' || type_left.nil? - %td.old_line{id: line_code_left, class: "#{type_left}"} - = link_to raw(line_number_left), "##{line_code_left}", id: line_code_left - %td.line_content{class: "parallel noteable_line #{type_left} #{line_code_left}", "line_code" => line_code_left }= raw line_content_left - - - if type_right == 'new' - - new_line_class = 'new' - - new_line_code = line_code_right - - else - - new_line_class = nil - - new_line_code = line_code_left - - %td.new_line{id: new_line_code, class: "#{new_line_class}", data: { linenumber: line_number_right }} - = link_to raw(line_number_right), "##{new_line_code}", id: new_line_code - %td.line_content.parallel{class: "noteable_line #{new_line_class} #{new_line_code}", "line_code" => new_line_code}= raw line_content_right - - - if @reply_allowed - - comments_left, comments_right = organize_comments(type_left, type_right, line_code_left, line_code_right) - - if comments_left.present? || comments_right.present? - = render "projects/notes/diff_notes_with_reply_parallel", notes1: comments_left, notes2: comments_right - -- if diff_file.diff.diff.blank? && diff_file.mode_changed? - .file-mode-changed - File mode changed diff --git a/app/views/projects/diffs/_stats.html.haml b/app/views/projects/diffs/_stats.html.haml deleted file mode 100644 index 1625930615a..00000000000 --- a/app/views/projects/diffs/_stats.html.haml +++ /dev/null @@ -1,38 +0,0 @@ -.js-toggle-container - .commit-stat-summary - Showing - = link_to '#', class: 'js-toggle-button' do - %strong #{pluralize(diffs.count, "changed file")} - - if current_controller?(:commit) - - unless @commit.has_zero_stats? - with - %strong.cgreen #{@commit.stats.additions} additions - and - %strong.cred #{@commit.stats.deletions} deletions - .file-stats.js-toggle-content.hide - %ul.bordered-list - - diffs.each_with_index do |diff, i| - %li - - if diff.deleted_file - %span.deleted-file - %a{href: "#diff-#{i}"} - %i.fa.fa-minus - = diff.old_path - - elsif diff.renamed_file - %span.renamed-file - %a{href: "#diff-#{i}"} - %i.fa.fa-minus - = diff.old_path - → - = diff.new_path - - elsif diff.new_file - %span.new-file - %a{href: "#diff-#{i}"} - %i.fa.fa-plus - = diff.new_path - - else - %span.edit-file - %a{href: "#diff-#{i}"} - %i.fa.fa-adjust - = diff.new_path - diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml deleted file mode 100644 index e6dfbfd6511..00000000000 --- a/app/views/projects/diffs/_text_file.html.haml +++ /dev/null @@ -1,36 +0,0 @@ -- too_big = diff_file.diff_lines.count > Commit::DIFF_SAFE_LINES -- if too_big - %a.supp_diff_link Changes suppressed. Click to show - -%table.text-file{class: "#{'hide' if too_big}"} - - last_line = 0 - - diff_file.diff_lines.each_with_index do |line, index| - - type = line.type - - last_line = line.new_pos - - line_code = generate_line_code(diff_file.file_path, line) - - line_old = line.old_pos - %tr.line_holder{ id: line_code, class: "#{type}" } - - if type == "match" - = render "projects/diffs/match_line", {line: line.text, - line_old: line_old, line_new: line.new_pos, bottom: false} - - else - %td.old_line - = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code - - if @comments_allowed && can?(current_user, :write_note, @project) - = link_to_new_diff_note(line_code) - %td.new_line{data: {linenumber: line.new_pos}} - = link_to raw(type == "old" ? " " : line.new_pos) , "##{line_code}", id: line_code - %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line.text) - - - if @reply_allowed - - comments = @line_notes.select { |n| n.line_code == line_code && n.active? }.sort_by(&:created_at) - - unless comments.empty? - = render "projects/notes/diff_notes_with_reply", notes: comments, line: line.text - - - if last_line > 0 - = render "projects/diffs/match_line", {line: "", - line_old: last_line, line_new: last_line, bottom: true} - -- if diff_file.diff.blank? && diff_file.mode_changed? - .file-mode-changed - File mode changed diff --git a/app/views/projects/diffs/_warning.html.haml b/app/views/projects/diffs/_warning.html.haml deleted file mode 100644 index 47abbba2eb2..00000000000 --- a/app/views/projects/diffs/_warning.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -.alert.alert-warning - %h4 - Too many changes. - .pull-right - - unless diff_hard_limit_enabled? - = link_to "Reload with full diff", url_for(params.merge(force_show_diff: true)), class: "btn btn-sm btn-warning" - - - if current_controller?(:commit) or current_controller?(:merge_requests) - - if current_controller?(:commit) - = link_to "Plain diff", namespace_project_commit_path(@project.namespace, @project, @commit, format: :diff), class: "btn btn-warning btn-sm" - = link_to "Email patch", namespace_project_commit_path(@project.namespace, @project, @commit, format: :patch), class: "btn btn-warning btn-sm" - - elsif @merge_request && @merge_request.persisted? - = link_to "Plain diff", merge_request_path(@merge_request, format: :diff), class: "btn btn-warning btn-sm" - = link_to "Email patch", merge_request_path(@merge_request, format: :patch), class: "btn btn-warning btn-sm" - %p - To preserve performance only - %strong #{allowed_diff_size} of #{diffs.size} - files are displayed. - |