* Renamed moderator/post/dashboard to moderator/post/queue
* Fixed bug with more overlay links being out of place if news listing is closed
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
26
app/assets/stylesheets/specific/mod_queue.css.scss
Normal file
26
app/assets/stylesheets/specific/mod_queue.css.scss
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Moderator
|
||||
module Post
|
||||
class DashboardsController < ApplicationController
|
||||
class QueuesController < ApplicationController
|
||||
respond_to :html, :json
|
||||
before_filter :janitor_only
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
|
||||
<div id="page">
|
||||
<%- if flash[:notice] -%>
|
||||
<div class="ui-corner-all ui-state-highlight" id="notice"><span class="ui-icon ui-icon-info"></span> <%= flash[:notice] %></div>
|
||||
<div class="ui-corner-all ui-state-highlight" id="notice"><%= flash[:notice] %></div>
|
||||
<%- else -%>
|
||||
<div class="ui-corner-all ui-state-highlight" id="notice" style="display: none;"><span class="ui-icon ui-icon-info"></span></div>
|
||||
<div class="ui-corner-all ui-state-highlight" id="notice" style="display: none;"></div>
|
||||
<%- end -%>
|
||||
|
||||
<%= yield :layout %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div id="c-moderator-post-dashboards">
|
||||
<div id="c-moderator-post-queues">
|
||||
<div id="a-show">
|
||||
<div id="search">
|
||||
<%= form_tag(moderator_post_dashboard_path, :method => :get) do %>
|
||||
<%= form_tag(moderator_post_queue_path, :method => :get) do %>
|
||||
<%= text_field_tag "query", params[:query], :size => 40 %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
@@ -9,6 +9,20 @@
|
||||
|
||||
<div>
|
||||
<h1>Moderation Queue</h1>
|
||||
|
||||
<div id="moderation-guideline">
|
||||
<h1>Deletion Guidelines</h1>
|
||||
<p>
|
||||
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 %>
|
||||
</p>
|
||||
|
||||
<p><%= button_tag "Approve all", :id => "approve-all-button" %><%= button_tag "Hide all", :id => "hide-all-button" %></p>
|
||||
</div>
|
||||
|
||||
<% @posts.each do |post| %>
|
||||
<article id="post-<%= post.id %>">
|
||||
@@ -41,5 +55,5 @@
|
||||
<%= render "posts/partials/common/secondary_links" %>
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
Mod Dashboard - <%= Danbooru.config.app_name %>
|
||||
Mod Queue - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
@@ -1,8 +1,10 @@
|
||||
<div id="news-ticker" data-updated-at="2011-09-01">
|
||||
<ul>
|
||||
<li>10/22: Database has been reset</li>
|
||||
<li>Report issues on <a href="https://github.com/r888888888/danbooru/issues/new">Github</a> or the <a href="http://danbooru.donmai.us/forum/show/65870">forum</a></li>
|
||||
</ul>
|
||||
<% unless cookies["news-ticker"] == "2011-09-01" %>
|
||||
<div id="news-ticker" data-updated-at="2011-09-01">
|
||||
<ul>
|
||||
<li>10/22: Database has been reset</li>
|
||||
<li>Report issues on <a href="https://github.com/r888888888/danbooru/issues/new">Github</a> or the <a href="http://danbooru.donmai.us/forum/show/65870">forum</a></li>
|
||||
</ul>
|
||||
|
||||
<a href="#" id="close-news-ticker-link">close</a>
|
||||
</div>
|
||||
<a href="#" id="close-news-ticker-link">close</a>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -10,7 +10,7 @@
|
||||
<% end %>
|
||||
<li><%= link_to "Changes", post_versions_path %></li>
|
||||
<% if CurrentUser.is_janitor? %>
|
||||
<li><%= link_to "Moderate", moderator_post_dashboard_path %></li>
|
||||
<li><%= link_to "Moderate", moderator_post_queue_path %></li>
|
||||
<% end %>
|
||||
<li><%= link_to "Help", wiki_pages_path(:title => "help:posts") %></li>
|
||||
</menu>
|
||||
|
||||
@@ -12,7 +12,7 @@ Danbooru::Application.routes.draw do
|
||||
resources :invitations, :only => [:new, :create, :index]
|
||||
resource :tag, :only => [:edit, :update]
|
||||
namespace :post do
|
||||
resource :dashboard, :only => [:show]
|
||||
resource :queue, :only => [:show]
|
||||
resource :approval, :only => [:create]
|
||||
resource :disapproval, :only => [:create]
|
||||
resources :posts, :only => [:delete, :undelete] do
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
bundle exec rake db:drop db:create
|
||||
createlang plpgsql danbooru2
|
||||
bundle exec rake db:migrate
|
||||
bundle exec rake db:seed
|
||||
|
||||
@@ -2,8 +2,8 @@ require 'test_helper'
|
||||
|
||||
module Moderator
|
||||
module Post
|
||||
class DashboardsControllerTest < ActionController::TestCase
|
||||
context "The moderator post dashboards controller" do
|
||||
class QueuesControllerTest < ActionController::TestCase
|
||||
context "The moderator post queues controller" do
|
||||
setup do
|
||||
@admin = Factory.create(:admin_user)
|
||||
CurrentUser.user = @admin
|
||||
Reference in New Issue
Block a user