#1849: filter images for safebooru

This commit is contained in:
r888888888
2013-07-18 17:26:52 -07:00
parent 5ad3571d8b
commit 22bd07072a
6 changed files with 21 additions and 14 deletions

View File

@@ -3,12 +3,8 @@ class PostPresenter < Presenter
if post.is_deleted? && options[:tags] !~ /status:(?:all|any|deleted|banned)/ && !options[:raw]
return ""
end
if post.is_banned? && !CurrentUser.is_gold?
return ""
end
unless Danbooru.config.can_user_see_post?(CurrentUser.user, post)
if !post.visible?
return ""
end
@@ -138,6 +134,7 @@ class PostPresenter < Presenter
def image_html(template)
return template.content_tag("p", "The artist requested removal of this image") if @post.is_banned? && !CurrentUser.user.is_gold?
return template.content_tag("p", template.link_to("You need a gold account to see this image.", template.upgrade_information_users_path)) if !Danbooru.config.can_user_see_post?(CurrentUser.user, @post)
return template.content_tag("p", "This image is unavailable") if !@post.visible?
if @post.is_flash?
template.render("posts/partials/show/flash", :post => @post)