From 1919bbf07e2498e4b52d093ea64d450a66fbfcbf Mon Sep 17 00:00:00 2001 From: Toks Date: Tue, 14 Oct 2014 13:14:36 -0400 Subject: [PATCH] Update mod queue post previews for consistency with rest of site Fixes display of borders on the previews and such. Also fix the yellow duplicate background not always working because Post#has_dup_tag? didn't return a boolean. --- app/assets/javascripts/mod_queue.js | 2 +- .../stylesheets/specific/mod_queue.css.scss | 40 +++++++++---------- app/models/post.rb | 2 +- app/views/moderator/post/queues/show.html.erb | 6 +-- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/assets/javascripts/mod_queue.js b/app/assets/javascripts/mod_queue.js index 4c53eaa16..95382c5e6 100644 --- a/app/assets/javascripts/mod_queue.js +++ b/app/assets/javascripts/mod_queue.js @@ -24,7 +24,7 @@ } Danbooru.ModQueue.initialize_hilights = function() { - $.each($("article.post"), function(i, v) { + $.each($("div.post"), function(i, v) { var $post = $(v); var score = parseInt($post.data("score")); if (score >= 3) { diff --git a/app/assets/stylesheets/specific/mod_queue.css.scss b/app/assets/stylesheets/specific/mod_queue.css.scss index 091fceec1..9feafa462 100644 --- a/app/assets/stylesheets/specific/mod_queue.css.scss +++ b/app/assets/stylesheets/specific/mod_queue.css.scss @@ -1,33 +1,33 @@ @import "../common/000_vars.css.scss"; div#c-moderator-post-queues { - article { + div.post { margin-bottom: 4em; overflow: hidden; - } - article.post-has-dup { - background: rgb(255, 255, 100); - } + &.post-has-dup { + background: rgb(255, 255, 100); + } - article.post-neg-score { - background: rgb(255, 230, 230); - } + &.post-neg-score { + background: rgb(255, 230, 230); + } - article.post-pos-score { - background: rgb(230, 255, 230); - } + &.post-pos-score { + background: rgb(230, 255, 230); + } - aside { - float: left; - width: 220px; - text-align: right; - padding-right: 20px; - } + aside { + float: left; + width: 220px; + text-align: right; + padding-right: 20px; + } - section { - float: left; - width: 600px; + section { + float: left; + width: 600px; + } } div#moderation-guideline { diff --git a/app/models/post.rb b/app/models/post.rb index 4ea7e3108..59a2542d4 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -636,7 +636,7 @@ class Post < ActiveRecord::Base end def has_tag?(tag) - tag_string =~ /(?:^| )#{tag}(?:$| )/ + !!(tag_string =~ /(?:^| )#{tag}(?:$| )/) end def has_dup_tag? diff --git a/app/views/moderator/post/queues/show.html.erb b/app/views/moderator/post/queues/show.html.erb index 5abf215ac..254e0f4a2 100644 --- a/app/views/moderator/post/queues/show.html.erb +++ b/app/views/moderator/post/queues/show.html.erb @@ -25,7 +25,7 @@ <% @posts.each do |post| %> -
+
data-has-dup="<%= post.has_dup_tag? %>"> @@ -42,7 +42,7 @@ (<%= post.image_width %>x<%= post.image_height %>) <% end %> -
  • Uploader: <%= link_to(post.uploader.name, user_path(post.uploader_id)) %> <%= time_ago_in_words_tagged(post.created_at) %>
  • +
  • Uploader: <%= link_to_user(post.uploader) %> <%= time_ago_in_words_tagged(post.created_at) %>
  • <% if post.is_flagged? %>
  • Flagged: <%= post_flag_reasons(post) %>
  • <% end %> @@ -53,7 +53,7 @@
  • Tags: <%= post.tag_string %>
  • -
    + <% end %>