posts: fix paginator not appearing when all posts are hidden.
Fix the paginator not appearing when all posts on the page are hidden, because of deleted posts, banned artists, censored tags, or non-safe posts in safe mode. This prevented navigating to the next or previous page.
This commit is contained in:
@@ -355,7 +355,7 @@ Post.initialize_excerpt = function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!$(".post-preview").length && /Nobody here but us chickens/.test($("#posts").html())) {
|
if (!$(".post-preview").length && /No posts found/.test($("#posts").html())) {
|
||||||
$("#show-excerpt-link").click();
|
$("#show-excerpt-link").click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,12 +67,6 @@ module PostSets
|
|||||||
posts.any? {|x| x.rating == "e"}
|
posts.any? {|x| x.rating == "e"}
|
||||||
end
|
end
|
||||||
|
|
||||||
def shown_posts
|
|
||||||
shown_posts = posts.select(&:visible?)
|
|
||||||
shown_posts = shown_posts.reject(&:is_deleted?) unless show_deleted?
|
|
||||||
shown_posts
|
|
||||||
end
|
|
||||||
|
|
||||||
def hidden_posts
|
def hidden_posts
|
||||||
posts.reject(&:visible?)
|
posts.reject(&:visible?)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -223,9 +223,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="posts">
|
<div id="posts">
|
||||||
<% if @post_set.shown_posts.empty? %>
|
|
||||||
<%= render "post_sets/blank" %>
|
|
||||||
<% else %>
|
|
||||||
<%= render_post_gallery(@post_set.posts, show_deleted: @post_set.show_deleted?, tags: @post_set.tag_string, show_votes: @post_set.show_votes?, size: @preview_size) do |gallery, posts| %>
|
<%= render_post_gallery(@post_set.posts, show_deleted: @post_set.show_deleted?, tags: @post_set.tag_string, show_votes: @post_set.show_votes?, size: @preview_size) do |gallery, posts| %>
|
||||||
<% gallery.footer do %>
|
<% gallery.footer do %>
|
||||||
<% if @post_set.hidden_posts.present? %>
|
<% if @post_set.hidden_posts.present? %>
|
||||||
@@ -260,7 +257,6 @@
|
|||||||
<%= numbered_paginator(posts) %>
|
<%= numbered_paginator(posts) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user