Download link for binary
This commit is contained in:
parent
0712e78597
commit
ed3f3a0d4d
BIN
app/assets/images/download.png
Normal file
BIN
app/assets/images/download.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
|
@ -32,4 +32,13 @@ class TreeDecorator < ApplicationDecorator
|
||||||
def history_path
|
def history_path
|
||||||
h.project_commits_path(project, :path => path, :ref => ref)
|
h.project_commits_path(project, :path => path, :ref => ref)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def mb_size
|
||||||
|
size = (tree.size / 1024)
|
||||||
|
if size < 1024
|
||||||
|
"#{size} KB"
|
||||||
|
else
|
||||||
|
"#{size/1024} MB"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
%td= f.label :default_branch, "Default Branch"
|
%td= f.label :default_branch, "Default Branch"
|
||||||
%td= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;")
|
%td= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;")
|
||||||
|
|
||||||
%tr
|
-#%tr
|
||||||
%td= f.label :tag_list
|
%td= f.label :tag_list
|
||||||
%td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field
|
%td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field
|
||||||
%tr
|
%tr
|
||||||
|
|
|
@ -20,6 +20,10 @@
|
||||||
.view_file_content_image
|
.view_file_content_image
|
||||||
%img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
|
%img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
|
||||||
- else
|
- else
|
||||||
%p
|
%center
|
||||||
%center No preview for this file type
|
= link_to blob_project_ref_path(@project, @ref, :path => params[:path] ) do
|
||||||
|
%div
|
||||||
|
%br
|
||||||
|
= image_tag "download.png", :width => 64
|
||||||
|
%h3
|
||||||
|
Download (#{file.mb_size})
|
||||||
|
|
Loading…
Reference in a new issue