_tree_file.html.haml 712 字节
Newer Older
G
gitlabhq 已提交
1
:css
G
gitlabhq 已提交
2 3 4 5
.view_file
  .view_file_header
    %strong
      = name
G
gitlabhq 已提交
6 7
      = link_to "raw", blob_project_ref_path(@project, @ref, :path => params[:path] ), :class => "right", :target => "_blank"
      = link_to "history", project_commits_path(@project, :path => params[:path], :ref => @ref ), :class => "right", :style => "margin-right:10px;"
G
gitlabhq 已提交
8
      %br/
G
gitlabhq 已提交
9
  - if file.text?
G
gitlabhq 已提交
10
    .view_file_content
G
gitlabhq 已提交
11 12 13 14 15 16
      - unless file.empty?
        :erb
          <%= raw file.colorize %>
      - else 
        %h3
          %center Empty file
G
gitlabhq 已提交
17
  - elsif file.image?
G
gitlabhq 已提交
18
    .view_file_content_image
G
gitlabhq 已提交
19
      %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
G
gitlabhq 已提交
20
  - else
21
    %p
G
gitlabhq 已提交
22 23
      %center No preview for this file type