2011-10-21 08:35:42 -04:00
|
|
|
:css
|
2011-10-08 17:36:38 -04:00
|
|
|
.view_file
|
|
|
|
.view_file_header
|
2012-02-27 17:00:19 -05:00
|
|
|
.row
|
2012-03-26 05:11:02 -04:00
|
|
|
.span1.file_icon= image_tag(file.image? ? "file_img.png" : "file_txt.png")
|
2012-02-27 17:00:19 -05:00
|
|
|
.span2.mode_text= file.mode
|
2012-04-10 01:51:08 -04:00
|
|
|
.span5.file_name= name
|
|
|
|
.span3.right
|
2012-03-26 05:11:02 -04:00
|
|
|
= 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;"
|
2011-10-20 15:00:00 -04:00
|
|
|
- if file.text?
|
2011-10-08 17:36:38 -04:00
|
|
|
.view_file_content
|
2011-11-22 07:50:47 -05:00
|
|
|
- unless file.empty?
|
2012-04-20 17:21:12 -04:00
|
|
|
%div{:class => current_user.dark_scheme ? "black" : "white"}
|
|
|
|
= preserve do
|
|
|
|
= raw file.colorize(options: { linenos: 'True'})
|
|
|
|
- else
|
2011-11-22 07:50:47 -05:00
|
|
|
%h3
|
|
|
|
%center Empty file
|
2011-10-20 15:00:00 -04:00
|
|
|
- elsif file.image?
|
2011-10-08 17:36:38 -04:00
|
|
|
.view_file_content_image
|
2011-10-20 15:00:00 -04:00
|
|
|
%img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
|
2011-10-08 17:36:38 -04:00
|
|
|
- else
|
2011-12-15 01:42:24 -05:00
|
|
|
%center
|
2012-03-26 05:11:02 -04:00
|
|
|
= link_to blob_project_ref_path(@project, @ref, :path => params[:path]) do
|
2011-12-15 01:42:24 -05:00
|
|
|
%div
|
|
|
|
%br
|
|
|
|
= image_tag "download.png", :width => 64
|
|
|
|
%h3
|
|
|
|
Download (#{file.mb_size})
|