Compare view for commits
This commit is contained in:
parent
6c416aaac8
commit
422e43989b
13 changed files with 135 additions and 61 deletions
|
@ -1,15 +1,6 @@
|
|||
- if @commits.size > 0
|
||||
.merge-request-commits
|
||||
- @commits.each do |commit|
|
||||
.entry
|
||||
= link_to project_commit_path(@project, :id => commit.id) do
|
||||
%strong
|
||||
= truncate(commit.id.to_s, :length => 10)
|
||||
= image_tag gravatar_icon(commit.author_email), :class => "", :width => 16
|
||||
%span= truncate(commit.safe_message, :length => 40)
|
||||
%span.right
|
||||
= time_ago_in_words(commit.committed_date)
|
||||
ago
|
||||
%ul.unstyled= render @commits
|
||||
|
||||
- if @commits.empty?
|
||||
%p.cgray Nothing to merge
|
||||
|
|
|
@ -1,26 +1,3 @@
|
|||
.file_stats
|
||||
= render "commits/diff_head", :diffs => @diffs
|
||||
- @diffs.each_with_index do |diff, i|
|
||||
- next if diff.diff.empty?
|
||||
- file = (@commit.tree / diff.b_path)
|
||||
- next unless file
|
||||
.diff_file
|
||||
.diff_file_header
|
||||
- if diff.deleted_file
|
||||
%strong{:id => "#{diff.b_path}"}= diff.a_path
|
||||
- else
|
||||
= link_to tree_file_project_ref_path(@project, @commit.id, diff.b_path) do
|
||||
%strong{:id => "#{diff.b_path}"}= diff.b_path
|
||||
%br/
|
||||
.diff_file_content
|
||||
- if file.text?
|
||||
= render :partial => "commits/text_file", :locals => { :diff => diff, :index => i }
|
||||
- elsif file.image?
|
||||
.diff_file_content_image
|
||||
%img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
|
||||
- else
|
||||
%p
|
||||
%center No preview for this file type
|
||||
|
||||
= render "commits/diffs", :diffs => @diffs
|
||||
- if @diffs.empty?
|
||||
%p.cgray Nothing to merge
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue