diff --git a/app/assets/javascripts/comments.js b/app/assets/javascripts/comments.js index 31b119d60..8f025c816 100644 --- a/app/assets/javascripts/comments.js +++ b/app/assets/javascripts/comments.js @@ -4,6 +4,7 @@ Danbooru.Comment.initialize_all = function() { this.initialize_response_link(); this.initialize_reply_links(); + this.initialize_expand_links(); } Danbooru.Comment.quote_message = function(data) { @@ -30,6 +31,15 @@ $(".reply-link").click(Danbooru.Comment.quote); } + Danbooru.Comment.initialize_expand_links = function() { + $(".comment-section form").hide(); + $(".comment-section input.expand-comment-response").click(function() { + var post_id = $(this).closest(".comment-section").data("post-id"); + $(".comment-section[data-post-id=" + post_id + "] form").show(); + $(this).hide(); + }); + } + Danbooru.Comment.initialize_response_link = function() { $("a.expand-comment-response").click(function(e) { e.preventDefault(); diff --git a/app/assets/javascripts/common.js b/app/assets/javascripts/common.js index a46217aa2..4ed12d1e3 100644 --- a/app/assets/javascripts/common.js +++ b/app/assets/javascripts/common.js @@ -8,14 +8,6 @@ $(document).ready(function() { $("table.striped tbody tr:even").addClass("even"); $("table.striped tbody tr:odd").addClass("odd"); - // Comment listing - $(".comment-section form").hide(); - $(".comment-section input.expand-comment-response").click(function() { - var post_id = $(this).closest(".comment-section").data("post-id"); - $(".comment-section[data-post-id=" + post_id + "] form").show(); - $(this).hide(); - }); - // More link $("#site-map-link").click(function(e) { $("#more-links").toggle(); @@ -37,23 +29,6 @@ $(document).ready(function() { Danbooru.ajax_stop(e.target); }) - // Image resize sidebar - $("#resize-links").hide(); - - $("#resize-links a").click(function(e) { - var image = $("#image"); - var target = $(e.target); - image.attr("src", target.data("src")); - image.attr("width", target.data("width")); - image.attr("height", target.data("height")); - e.preventDefault(); - }); - - $("#resize-link a").click(function(e) { - $("#resize-links").toggle(); - e.preventDefault(); - }); - // TOS link if (!location.href.match(/terms_of_service/) && Danbooru.Cookie.get("tos") !== "1") { // Setting location.pathname in Safari doesn't work, so manually extract the domain. diff --git a/app/assets/javascripts/news.js b/app/assets/javascripts/news.js index 048928056..9fba309c1 100644 --- a/app/assets/javascripts/news.js +++ b/app/assets/javascripts/news.js @@ -10,6 +10,10 @@ $("#close-news-ticker-link").click(function(e) { $("#news-ticker").hide(); Danbooru.Cookie.put("news-ticker", key); + + // need to reset the more link + $("#more-links").hide().offset({top: $("#site-map-link").offset().top + $("#site-map-link").height() + 10, left: $("#site-map-link").offset().left}); + return false; }); } diff --git a/app/assets/javascripts/posts.js b/app/assets/javascripts/posts.js index a880efc3c..ba1f0e716 100644 --- a/app/assets/javascripts/posts.js +++ b/app/assets/javascripts/posts.js @@ -10,6 +10,7 @@ this.initialize_image_resize(); this.initialize_titles(); this.initialize_links(); + this.initialize_resize_links(); } Danbooru.Post.initialize_links = function() { @@ -20,6 +21,24 @@ }); } + Danbooru.Post.initialize_resize_links = function() { + $("#resize-links").hide(); + + $("#resize-links a").click(function(e) { + var image = $("#image"); + var target = $(e.target); + image.attr("src", target.data("src")); + image.attr("width", target.data("width")); + image.attr("height", target.data("height")); + e.preventDefault(); + }); + + $("#resize-link a").click(function(e) { + $("#resize-links").toggle(); + e.preventDefault(); + }); + } + Danbooru.Post.initialize_titles = function() { $("article.post-preview").each(function(i, v) { Danbooru.Post.initialize_title_for(v); diff --git a/app/assets/stylesheets/specific/mod_queue.css.scss b/app/assets/stylesheets/specific/mod_queue.css.scss new file mode 100644 index 000000000..1e4d84a84 --- /dev/null +++ b/app/assets/stylesheets/specific/mod_queue.css.scss @@ -0,0 +1,26 @@ +@import "../common/000_vars.css.scss"; + +div#c-moderator-post-queues { + article { + margin-bottom: 4em; + overflow: hidden; + } + + aside { + float: left; + width: 520px; + } + + section { + float: left; + width: 300px; + } + + div#moderation-guideline { + width: 60em; + + h1 { + font-size: $h2_size; + } + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/specific/posts.css.scss b/app/assets/stylesheets/specific/posts.css.scss index f1997da73..fd9e6ea07 100644 --- a/app/assets/stylesheets/specific/posts.css.scss +++ b/app/assets/stylesheets/specific/posts.css.scss @@ -194,19 +194,3 @@ div#unapprove-dialog { } } -div#c-moderator-post-dashboards { - article { - margin-bottom: 4em; - overflow: hidden; - } - - aside { - float: left; - width: 520px; - } - - section { - float: left; - width: 300px; - } -} diff --git a/app/controllers/moderator/post/dashboards_controller.rb b/app/controllers/moderator/post/queues_controller.rb similarity index 86% rename from app/controllers/moderator/post/dashboards_controller.rb rename to app/controllers/moderator/post/queues_controller.rb index 59159c628..53871b453 100644 --- a/app/controllers/moderator/post/dashboards_controller.rb +++ b/app/controllers/moderator/post/queues_controller.rb @@ -1,6 +1,6 @@ module Moderator module Post - class DashboardsController < ApplicationController + class QueuesController < ApplicationController respond_to :html, :json before_filter :janitor_only diff --git a/app/models/upload.rb b/app/models/upload.rb index 4af725857..62e1d50c1 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -133,16 +133,12 @@ class Upload < ActiveRecord::Base def generate_resizes(source_path) if is_image? generate_resize_for(Danbooru.config.small_image_width, Danbooru.config.small_image_width, source_path, 85) - generate_resize_for(Danbooru.config.medium_image_width, nil, source_path) - generate_resize_for(Danbooru.config.large_image_width, nil, source_path) + generate_resize_for(Danbooru.config.medium_image_width, nil, source_path) if image_width > Danbooru.config.medium_image_width + generate_resize_for(Danbooru.config.large_image_width, nil, source_path) if image_width > Danbooru.config.large_image_width end end def generate_resize_for(width, height, source_path, quality = 90) - return if width.nil? - return unless image_width > width - return unless height.nil? || image_height > height - unless File.exists?(source_path) raise Error.new("file not found") end diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb index dbf86973e..0058b85c5 100644 --- a/app/views/layouts/default.html.erb +++ b/app/views/layouts/default.html.erb @@ -36,9 +36,9 @@
+ 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 score -3 or lower are marked red. Posts with score 3 or higher are marked green. + <% if params[:hidden] %> + <%= link_to "View all posts", moderator_post_queue_path(:query => params[:query], :hidden => nil) %>. + <% else %> + <%= link_to "View hidden posts", moderator_post_queue_path(:query => params[:query], :hidden => true) %>. + <% end %> +
+ +<%= button_tag "Approve all", :id => "approve-all-button" %><%= button_tag "Hide all", :id => "hide-all-button" %>
+