This commit is contained in:
albert
2010-03-26 16:19:12 -04:00
parent 3416a5dbcb
commit 3666364469
3 changed files with 64 additions and 53 deletions

View File

@@ -1,22 +1,22 @@
class PostPresenter < Presenter
def initialize(post, current_user)
def initialize(post)
@post = post
@current_user = current_user
end
def tag_list_html
end
def image_html(template)
return "" if @post.is_deleted? && !@current_user.is_janitor?
def image_html(template, current_user)
return "" if @post.is_deleted? && !current_user.is_janitor?
if @post.is_flash?
template.render(:partial => "posts/flash", :locals => {:post => @post})
elsif @post.is_image?
template.image_tag(
@post.file_path_for(@current_user),
:width => @post.image_width_for(@current_user),
:height => @post.image_height_for(@current_user),
@post.file_url_for(current_user),
:alt => @post.tag_string,
:width => @post.image_width_for(current_user),
:height => @post.image_height_for(current_user),
"data-original-width" => @post.image_width,
"data-original-height" => @post.image_height
)