modqueue: move quality warning tags into config file.

This commit is contained in:
evazion
2018-04-17 17:15:06 -05:00
parent 41eba9d6b4
commit 17aabaca29
5 changed files with 32 additions and 31 deletions

View File

@@ -7,3 +7,4 @@
// https://github.com/rails/sass-rails/issues/185
@import "specific/*";
@import "specific/erb/posts";
@import "specific/erb/mod_queue";

View File

@@ -1,4 +1,4 @@
@import "../common/000_vars.scss";
@import "../../common/000_vars.scss";
div#c-moderator-post-queues {
div.post {
@@ -25,22 +25,17 @@ div#c-moderator-post-queues {
width: 800px;
}
&[data-tags~="hard_translated"],
&[data-tags~="self_upload"],
&[data-tags~="nude_filter"],
&[data-tags~="photoshop"],
&[data-tags~="screencap"] {
background-color: $preview_quality_warning_color;
}
<% Danbooru.config.modqueue_quality_warning_tags.each do |tag| %>
&[data-tags~="<%= tag %>"] {
background-color: $preview_quality_warning_color;
}
<% end %>
&[data-tags~="duplicate"],
&[data-tags~="image_sample"],
&[data-tags~="md5_mismatch"],
&[data-tags~="resized"],
&[data-tags~="upscaled"],
&[data-tags~="downscaled"] {
background-color: $preview_sample_warning_color;
}
<% Danbooru.config.modqueue_sample_warning_tags.each do |tag| %>
&[data-tags~="<%= tag %>"] {
background-color: $preview_sample_warning_color;
}
<% end %>
&[data-tags~=animated], &[data-file-ext=swf], &[data-file-ext=webm], &[data-file-ext=zip], &[data-file-ext=mp4] {
aside:before {

View File

@@ -113,6 +113,14 @@ module ApplicationHelper
link_to ip, moderator_ip_addrs_path(:search => {:ip_addr => ip})
end
def link_to_wiki(*wiki_titles, **options)
links = wiki_titles.map do |title|
link_to title.tr("_", " "), wiki_pages_path(title: title)
end
to_sentence(links, **options)
end
def link_to_user(user, options = {})
user_class = user.level_class
user_class = user_class + " user-post-approver" if user.can_approve_posts?

View File

@@ -5,19 +5,6 @@
<p>
Posts with score -3 or lower are marked red.
Posts with score 3 or higher are marked green.
Posts with the
<%= link_to "hard translated", wiki_pages_path(title: "hard_translated") %>,
<%= link_to "self upload", wiki_pages_path(title: "self_upload") %>,
<%= link_to "nude filter", wiki_pages_path(title: "nude_filter") %>,
<%= link_to "photoshop", wiki_pages_path(title: "photoshop") %>, or
<%= link_to "screencap", wiki_pages_path(title: "screencap") %>
tag are marked in yellow.
Posts with the
<%= link_to "duplicate", wiki_pages_path(title: "duplicate") %>,
<%= link_to "image sample", wiki_pages_path(title: "image_sample") %>,
<%= link_to "md5 mismatch", wiki_pages_path(title: "md5_mismatch") %>,
<%= link_to "resized", wiki_pages_path(title: "resized") %>,
<%= link_to "upscaled", wiki_pages_path(title: "upscaled") %>, or
<%= link_to "downscaled", wiki_pages_path(title: "downscaled") %>
tag are marked in light red.
</p>
<p>Posts with the <%= link_to_wiki(*Danbooru.config.modqueue_quality_warning_tags, last_word_connector: ", or ") %> tags are marked in yellow.</p>
<p>Posts with the <%= link_to_wiki(*Danbooru.config.modqueue_sample_warning_tags, last_word_connector: ", or ") %> tags are marked in light red.</p>

View File

@@ -520,6 +520,16 @@ module Danbooru
tag =~ /replaceme|.*_sample|resized|upscaled|downscaled|md5_mismatch|jpeg_artifacts|corrupted_image/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 photoshop 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]
end
def shared_dir_path
"/var/www/danbooru2/shared"
end