add support for download files

This commit is contained in:
albert
2013-02-28 10:30:24 -08:00
parent b901859264
commit 71d1c71bc3
3 changed files with 4 additions and 1 deletions

View File

@@ -102,7 +102,7 @@ class Post < ActiveRecord::Base
end
def preview_file_url
if is_flash?
if !is_image?
return "/images/download-preview.png"
end

View File

@@ -66,6 +66,8 @@ class PostPresenter < Presenter
if @post.is_flash?
template.render("posts/partials/show/flash", :post => @post)
elsif !@post.is_image?
template.render("posts/partials/show/download", :post => @post)
elsif @post.is_image?
template.render("posts/partials/show/image", :post => @post)
end

View File

@@ -0,0 +1 @@
<p><%= link_to "Save this file (right click and save)", post.file_url %></p>