From c405c3d62db32e8656f8697537a0579327edc620 Mon Sep 17 00:00:00 2001 From: Toks Date: Sat, 27 Apr 2013 16:52:26 -0400 Subject: [PATCH] fixes #1458 --- app/assets/javascripts/posts.js | 22 ---------------------- app/presenters/post_presenter.rb | 9 ++++++++- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/app/assets/javascripts/posts.js b/app/assets/javascripts/posts.js index 75556ed0b..569054498 100644 --- a/app/assets/javascripts/posts.js +++ b/app/assets/javascripts/posts.js @@ -192,28 +192,6 @@ var $post = $(post); var $img = $post.find("img"); $img.attr("title", $post.attr("data-tags") + " user:" + $post.attr("data-uploader") + " rating:" + $post.data("rating") + " score:" + $post.data("score")); - - var status = $post.data("flags"); - - if (status.match(/pending/)) { - $post.addClass("post-status-pending"); - } - - if (status.match(/flagged/)) { - $post.addClass("post-status-flagged"); - } - - if (status.match(/deleted/)) { - $post.addClass("post-status-deleted"); - } - - if ($post.data("parent-id")) { - $post.addClass("post-status-has-parent"); - } - - if ($post.data("has-children")) { - $post.addClass("post-status-has-children"); - } } Danbooru.Post.initialize_post_image_resize_links = function() { diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 2528cac6b..6d1d21634 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -14,7 +14,14 @@ class PostPresenter < Presenter path = options[:path_prefix] || "/posts" - html = %{
} + klass = "post-preview" + klass << " post-status-pending" if post.is_pending? + klass << " post-status-flagged" if post.is_flagged? + klass << " post-status-deleted" if post.is_deleted? + klass << " post-status-has-parent" if post.parent_id + klass << " post-status-has-children" if post.has_children? + + html = %{
} if options[:tags].present? tag_param = "?tags=#{CGI::escape(options[:tags])}" elsif options[:pool_id]