From 85f16746187f43782f2f29722df0893bc6deaf92 Mon Sep 17 00:00:00 2001
From: evazion
Date: Tue, 3 Mar 2020 03:16:53 -0600
Subject: [PATCH] modqueue: highlight bad tags instead of entire post.
Change it so that when a post contains bad tags, the tags themselves are
highlighted rather than the entire post.
This also adds a data-tag-name attribute to tags in tag lists.
---
app/javascript/src/styles/base/040_colors.css | 6 ++----
.../src/styles/specific/mod_queue.scss.erb | 12 +++---------
app/presenters/tag_set_presenter.rb | 2 +-
app/views/modqueue/_desc.html.erb | 3 +--
config/danbooru_default_config.rb | 12 ++++--------
5 files changed, 11 insertions(+), 24 deletions(-)
diff --git a/app/javascript/src/styles/base/040_colors.css b/app/javascript/src/styles/base/040_colors.css
index 1d3f4be71..9887c5214 100644
--- a/app/javascript/src/styles/base/040_colors.css
+++ b/app/javascript/src/styles/base/040_colors.css
@@ -52,8 +52,7 @@
--preview-icon-color: white;
--preview-icon-background: rgba(0, 0, 0, 0.5);
- --modqueue-sample-warning-color: var(--error-background-color);
- --modqueue-quality-warning-color: var(--warning-background-color);
+ --modqueue-tag-warning-color: var(--error-background-color);
--uploads-dropzone-background: #EEE;
--uploads-dropzone-progress-bar-foreground-color: var(--link-color);
@@ -339,8 +338,7 @@ body[data-current-user-theme="dark"] {
--keyboard-shortcut-color: var(--text-color);
--keyboard-shortcut-background-color: var(--grey-2);
- --modqueue-sample-warning-color: var(--error-background-color);
- --modqueue-quality-warning-color: var(--warning-background-color);
+ --modqueue-tag-warning-color: var(--error-background-color);
--news-updates-background: var(--grey-3);
--news-updates-border: 2px solid var(--grey-4);
diff --git a/app/javascript/src/styles/specific/mod_queue.scss.erb b/app/javascript/src/styles/specific/mod_queue.scss.erb
index 51223a78b..9874a248c 100644
--- a/app/javascript/src/styles/specific/mod_queue.scss.erb
+++ b/app/javascript/src/styles/specific/mod_queue.scss.erb
@@ -26,15 +26,9 @@ div#c-modqueue {
}
}
- <% Danbooru.config.modqueue_quality_warning_tags.each do |tag| %>
- &[data-tags~="<%= tag %>"] {
- background-color: var(--modqueue-quality-warning-color);
- }
- <% end %>
-
- <% Danbooru.config.modqueue_sample_warning_tags.each do |tag| %>
- &[data-tags~="<%= tag %>"] {
- background-color: var(--modqueue-sample-warning-color);
+ <% Danbooru.config.modqueue_warning_tags.each do |tag| %>
+ li[data-tag-name="<%= tag %>"] {
+ background-color: var(--modqueue-tag-warning-color);
}
<% end %>
}
diff --git a/app/presenters/tag_set_presenter.rb b/app/presenters/tag_set_presenter.rb
index d79b8f704..e82342574 100644
--- a/app/presenters/tag_set_presenter.rb
+++ b/app/presenters/tag_set_presenter.rb
@@ -107,7 +107,7 @@ class TagSetPresenter < Presenter
count = tag.post_count
category = tag.category
- html = %{}
+ html = %{}
unless name_only
if category == Tag.categories.artist
diff --git a/app/views/modqueue/_desc.html.erb b/app/views/modqueue/_desc.html.erb
index 79a1f2752..17c073078 100644
--- a/app/views/modqueue/_desc.html.erb
+++ b/app/views/modqueue/_desc.html.erb
@@ -2,5 +2,4 @@
As a general rule, you should only approve of posts that you personally like. Posts that are not approved in three days will be automatically deleted.
-Posts with the <%= link_to_wikis(*Danbooru.config.modqueue_quality_warning_tags) %> tags are marked in yellow.
-Posts with the <%= link_to_wikis(*Danbooru.config.modqueue_sample_warning_tags) %> tags are marked in light red.
+The <%= link_to_wikis(*Danbooru.config.modqueue_warning_tags) %> tags are highlighted in red.
diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb
index 048446aa4..0a29b2d7d 100644
--- a/config/danbooru_default_config.rb
+++ b/config/danbooru_default_config.rb
@@ -359,14 +359,10 @@ module Danbooru
tag =~ /\A(?:replaceme|.*_sample|resized|upscaled|downscaled|md5_mismatch|jpeg_artifacts|corrupted_image|source_request|non-web_source)\z/i
end
- # Posts with these tags will be highlighted yellow in the modqueue.
- def modqueue_quality_warning_tags
- %w[hard_translated self_upload nude_filter third-party_edit screencap]
- end
-
- # Posts with these tags will be highlighted red in the modqueue.
- def modqueue_sample_warning_tags
- %w[duplicate image_sample md5_mismatch resized upscaled downscaled]
+ # Posts with these tags will be highlighted in the modqueue.
+ def modqueue_warning_tags
+ %w[hard_translated self_upload nude_filter third-party_edit screencap
+ duplicate image_sample md5_mismatch resized upscaled downscaled]
end
def stripe_secret_key