_tree_file.html.haml 858 字节
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;"
D
Dmitriy Zaporozhets 已提交
8
      = switch_colorscheme_link(:class => "right", :style => "margin-right:10px;color:orange")
G
gitlabhq 已提交
9
      %br/
G
gitlabhq 已提交
10
  - if file.text?
G
gitlabhq 已提交
11
    .view_file_content
G
gitlabhq 已提交
12
      - unless file.empty?
D
Dmitriy Zaporozhets 已提交
13 14 15
        %div{:class => cookies[:colorschema]} 
          :erb
            <%= raw file.colorize %>
G
gitlabhq 已提交
16 17 18
      - else 
        %h3
          %center Empty file
G
gitlabhq 已提交
19
  - elsif file.image?
G
gitlabhq 已提交
20
    .view_file_content_image
G
gitlabhq 已提交
21
      %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
G
gitlabhq 已提交
22
  - else
23
    %p
G
gitlabhq 已提交
24 25
      %center No preview for this file type