fixes #1371, additional fixes to seed script
This commit is contained in:
@@ -97,7 +97,12 @@
|
||||
}
|
||||
|
||||
Danbooru.Blacklist.posts = function() {
|
||||
return $(".post-preview");
|
||||
var previews = $(".post-preview");
|
||||
if (previews.length) {
|
||||
return previews;
|
||||
} else {
|
||||
return $("#image");
|
||||
}
|
||||
}
|
||||
|
||||
Danbooru.Blacklist.post_match = function(post, entry) {
|
||||
|
||||
@@ -18,7 +18,7 @@ a.blacklisted-active {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.post-preview.blacklisted-active {
|
||||
.post-preview.blacklisted-active, #image.blacklisted-active {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -262,6 +262,15 @@ class Post < ActiveRecord::Base
|
||||
@presenter ||= PostPresenter.new(self)
|
||||
end
|
||||
|
||||
def status_flags
|
||||
flags = []
|
||||
flags << "pending" if is_pending?
|
||||
flags << "flagged" if is_flagged?
|
||||
flags << "deleted" if is_deleted?
|
||||
flags << "banned" if is_banned?
|
||||
flags.join(" ")
|
||||
end
|
||||
|
||||
def pretty_rating
|
||||
case rating
|
||||
when "q"
|
||||
|
||||
@@ -12,15 +12,9 @@ class PostPresenter < Presenter
|
||||
return ""
|
||||
end
|
||||
|
||||
flags = []
|
||||
flags << "pending" if post.is_pending?
|
||||
flags << "flagged" if post.is_flagged?
|
||||
flags << "deleted" if post.is_deleted?
|
||||
flags << "banned" if post.is_banned?
|
||||
|
||||
path = options[:path_prefix] || "/posts"
|
||||
|
||||
html = %{<article class="post-preview" id="post_#{post.id}" data-id="#{post.id}" data-tags="#{h(post.tag_string)}" data-uploader="#{h(post.uploader_name)}" data-rating="#{post.rating}" data-width="#{post.image_width}" data-height="#{post.image_height}" data-flags="#{flags.join(' ')}" data-parent-id="#{post.parent_id}" data-has-children="#{post.has_children?}" data-score="#{post.score}">}
|
||||
html = %{<article class="post-preview" id="post_#{post.id}" data-id="#{post.id}" data-tags="#{h(post.tag_string)}" data-uploader="#{h(post.uploader_name)}" data-rating="#{post.rating}" data-width="#{post.image_width}" data-height="#{post.image_height}" data-flags="#{post.status_flags}" data-parent-id="#{post.parent_id}" data-has-children="#{post.has_children?}" data-score="#{post.score}" data-fav-count="#{post.fav_count}">}
|
||||
if options[:tags].present?
|
||||
tag_param = "?tags=#{CGI::escape(options[:tags])}"
|
||||
elsif options[:pool_id]
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<%= image_tag(post.file_url_for(CurrentUser.user), :width => post.image_width_for(CurrentUser.user), :height => post.image_height_for(CurrentUser.user), :id => "image", "data-original-width" => post.image_width, "data-original-height" => post.image_height, "data-large-width" => post.large_image_width, "data-large-height" => post.large_image_height) %>
|
||||
<%= image_tag(post.file_url_for(CurrentUser.user), :width => post.image_width_for(CurrentUser.user), :height => post.image_height_for(CurrentUser.user), :id => "image", "data-original-width" => post.image_width, "data-original-height" => post.image_height, "data-large-width" => post.large_image_width, "data-large-height" => post.large_image_height, "data-tags" => post.tag_string, "data-uploader" => post.uploader_name, "data-rating" => post.rating, "data-flags" => post.status_flags, "data-parent-id" => post.parent_id, "data-has-children" => post.has_children?, "data-score" => post.score, "data-fav-count" => post.fav_count) %>
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
<%= render "posts/partials/show/information", :post => @post %>
|
||||
</section>
|
||||
|
||||
<%= render "posts/partials/index/blacklist" %>
|
||||
|
||||
<% if CurrentUser.is_member? %>
|
||||
<section>
|
||||
<h1>Options</h1>
|
||||
|
||||
Reference in New Issue
Block a user