merge request: notes, diffs, commits
This commit is contained in:
parent
c0e5bc5ee8
commit
8803fbb593
8 changed files with 120 additions and 22 deletions
22
app/views/merge_requests/_diffs.html.haml
Normal file
22
app/views/merge_requests/_diffs.html.haml
Normal file
|
@ -0,0 +1,22 @@
|
|||
- @diffs.each do |diff|
|
||||
- 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 }
|
||||
- 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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue