_tree_file.html.haml 626 字节
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 11
    .view_file_content
      :erb
G
gitlabhq 已提交
12 13
        <%= raw file.colorize %>
  - elsif file.image?
G
gitlabhq 已提交
14
    .view_file_content_image
G
gitlabhq 已提交
15
      %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
G
gitlabhq 已提交
16
  - else
17
    %p
G
gitlabhq 已提交
18 19
      %center No preview for this file type