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.
This commit is contained in:
evazion
2020-03-03 03:16:53 -06:00
parent b0e2ffbe7d
commit 85f1674618
5 changed files with 11 additions and 24 deletions

View File

@@ -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);

View File

@@ -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 %>
}

View File

@@ -107,7 +107,7 @@ class TagSetPresenter < Presenter
count = tag.post_count
category = tag.category
html = %{<li class="tag-type-#{tag.category}">}
html = %{<li class="tag-type-#{tag.category}" data-tag-name="#{h(name)}">}
unless name_only
if category == Tag.categories.artist

View File

@@ -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.
</p>
<p>Posts with the <%= link_to_wikis(*Danbooru.config.modqueue_quality_warning_tags) %> tags are marked in yellow.</p>
<p>Posts with the <%= link_to_wikis(*Danbooru.config.modqueue_sample_warning_tags) %> tags are marked in light red.</p>
<p>The <%= link_to_wikis(*Danbooru.config.modqueue_warning_tags) %> tags are highlighted in red.</p>

View File

@@ -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