BigW Consortium Gitlab

_diff.html.haml 784 Bytes
Newer Older
gitlabhq committed
1 2
.file_stats= render "commits/diff_head"

gitlabhq committed
3 4 5 6 7 8 9 10
- @commit.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
Nihad Abbasov committed
11
      - else
gitlabhq committed
12
        = link_to tree_file_project_ref_path(@project, @commit.id, diff.b_path) do
gitlabhq committed
13
          %strong{:id => "#{diff.b_path}"}= diff.b_path
gitlabhq committed
14 15
      %br/
    .diff_file_content
gitlabhq committed
16
      - if file.text?
gitlabhq committed
17
        = render :partial => "commits/text_file", :locals => { :diff => diff }
gitlabhq committed
18
      - elsif file.image?
gitlabhq committed
19
        .diff_file_content_image
gitlabhq committed
20
          %img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
gitlabhq committed
21
      - else
Nihad Abbasov committed
22
        %p
gitlabhq committed
23
          %center No preview for this file type