fixed comment test
This commit is contained in:
@@ -3,9 +3,11 @@ class NotesController < ApplicationController
|
||||
before_filter :member_only, :except => [:index, :show]
|
||||
|
||||
def index
|
||||
@search = Note.search(params[:search])
|
||||
@notes = @search.paginate(:page => params[:page])
|
||||
respond_with(@notes)
|
||||
if params[:group_by] == "post"
|
||||
index_by_post
|
||||
else
|
||||
index_by_note
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
@@ -36,4 +38,21 @@ class NotesController < ApplicationController
|
||||
@note.revert_to!(@version)
|
||||
respond_with(@note)
|
||||
end
|
||||
|
||||
private
|
||||
def index_by_post
|
||||
@posts = Post.tag_match(params[:tags]).noted_before(params[:before_date] || Time.now).limit(8)
|
||||
respond_with(@posts) do |format|
|
||||
format.html {render :action => "index_by_post"}
|
||||
end
|
||||
end
|
||||
|
||||
def index_by_note
|
||||
@search = Note.search(params[:search])
|
||||
@notes = @search.paginate(:page => params[:page])
|
||||
respond_with(@notes) do |format|
|
||||
format.html {render :action => "index_by_note"}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -19,6 +19,10 @@ class PoolsController < ApplicationController
|
||||
respond_with(@pools)
|
||||
end
|
||||
|
||||
def search
|
||||
@search = Pool.search(params[:search])
|
||||
end
|
||||
|
||||
def show
|
||||
@pool = Pool.find(params[:id])
|
||||
@post_set = PostSets::Pool.new(@pool, :page => params[:page])
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
class StaticController < ApplicationController
|
||||
def jquery_test
|
||||
end
|
||||
end
|
||||
|
||||
@@ -27,6 +27,8 @@ class UsersController < ApplicationController
|
||||
|
||||
def create
|
||||
@user = User.create(params[:user])
|
||||
session[:user_id] = @user.id
|
||||
set_current_user
|
||||
respond_with(@user)
|
||||
end
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ class Post < ActiveRecord::Base
|
||||
scope :deleted, where(["is_deleted = ?", true])
|
||||
scope :visible, lambda {|user| Danbooru.config.can_user_see_post_conditions(user)}
|
||||
scope :commented_before, lambda {|date| where("last_commented_at < ?", date).order("last_commented_at DESC")}
|
||||
scope :noted_before, lambda {|date| where("last_noted_at < ?", date).order("last_noted_at DESC")}
|
||||
scope :for_user, lambda {|user_id| where(["uploader_string = ?", "uploader:#{user_id}"])}
|
||||
scope :available_for_moderation, lambda {where(["id NOT IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id])}
|
||||
scope :hidden_from_moderation, lambda {where(["id IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id])}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<% content_for("subnavbar") do %>
|
||||
<li><%= link_to "List", :action => "index" %></li>
|
||||
<li><%= link_to "Search", :action => "search" %></li>
|
||||
<li><%= link_to "History", :action => "history" %></li>
|
||||
<li><%= link_to "Requests", :controller => "post", :action => "index", :tags => "translation_request" %></li>
|
||||
<li><%= link_to "Help", :controller => "help", :action => "notes" %></li>
|
||||
<% content_for(:secondary_links) do %>
|
||||
<menu>
|
||||
<li><%= link_to "Listing", notes_path(:group_by => "post") %></li>
|
||||
<li><%= link_to "Search", search_notes_path %></li>
|
||||
<li><%= link_to "History", note_versions_path %></li>
|
||||
<li><%= link_to "Requests", posts_path(:tags => "translation_request") %></li>
|
||||
<li><%= link_to "Help", wiki_pages_path(:title => "help:notes") %></li>
|
||||
</menu>
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<div id="c-notes">
|
||||
<div id="a-index">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,7 +0,0 @@
|
||||
<div>
|
||||
<%= simple_form_for @search, :method => :get do |f| %>
|
||||
<%= f.input :name_contains, :label => "Name", :required => false %>
|
||||
<%= f.input :description_contains, :label => "Description", :required => false %>
|
||||
<%= f.button :submit, "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,6 +1,7 @@
|
||||
<% content_for(:secondary_links) do %>
|
||||
<menu>
|
||||
<li><%= link_to "Listing", pools_path %></li>
|
||||
<li><%= link_to "Search", search_pools_path %></li>
|
||||
<li><%= link_to "New", new_pool_path %></li>
|
||||
<% if @pool %>
|
||||
<li>|</li>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<div id="c-pools">
|
||||
<div id="a-index">
|
||||
<%= render "search" %>
|
||||
|
||||
<table class="striped" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<%= resize_image_links(post, CurrentUser.user) %>
|
||||
<li><%= link_to "Favorite", favorite_path(post), :remote => true, :method => :post, :id => "add-to-favorites" %></li>
|
||||
<li><%= link_to "Unfavorite", favorite_path(post), :remote => true, :method => :delete, :id => "remove-from-favorites" %></li>
|
||||
<li><%= link_to "Translate", "#" %></li>
|
||||
<li><%= link_to "Translate", "#", :id => "translate" %></li>
|
||||
<li><%= link_to "Flag", new_post_flag_path(:post_id => post.id), :id => "flag" %></li>
|
||||
<li><%= link_to "Appeal", new_post_appeal_path(:post_id => post.id), :id => "appeal" %></li>
|
||||
<% if CurrentUser.is_janitor? %>
|
||||
|
||||
@@ -34,8 +34,9 @@
|
||||
|
||||
<%= render :partial => "posts/partials/show/notices", :locals => {:post => @post} %>
|
||||
|
||||
<section id="image">
|
||||
<section id="image-container">
|
||||
<h2>Image</h2>
|
||||
<div id="note-container"></div>
|
||||
<%= @post.presenter.image_html(self) %>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div style="width: 40em; margin: 5em auto;">
|
||||
<div style="width: 40em; margin: 5em auto; overflow: scroll;">
|
||||
<div class="section">
|
||||
<h4>Terms of Service</h4>
|
||||
<p>By accessing the "<%= CONFIG["app_name"] %>" website ("Site") you agree to the following terms of service. If you do not agree to these terms, then please do not access the Site.</p>
|
||||
<p>By accessing the "<%= Danbooru.config.app_name %>" website ("Site") you agree to the following terms of service. If you do not agree to these terms, then please do not access the Site.</p>
|
||||
|
||||
<ul>
|
||||
<li>The Site reserves the right to change these terms at any time.</li>
|
||||
@@ -9,7 +9,7 @@
|
||||
<li>The Site is presented to you AS IS, without any warranty, express or implied. You will not hold the Site or its staff members liable for damages caused by the use of the site.</li>
|
||||
<li>The Site reserves the right to delete or modify your account, or any content you have posted to the site.</li>
|
||||
<li>You will make a best faith effort to upload only high quality anime-related images.</li>
|
||||
<li>You have read the <%= link_to "tagging guidelines", :controller => "help", :action => "tags" %>.</li>
|
||||
<li>You have read the <%= link_to "tagging guidelines", wiki_pages_path(:title => "help:tags") %>.</li>
|
||||
</ul>
|
||||
|
||||
<div class="section">
|
||||
@@ -36,7 +36,7 @@
|
||||
<div class="section">
|
||||
<h4>Copyright Infringement</h4>
|
||||
|
||||
<p>If you believe a post infringes upon your copyright, please send an email to the <%= mail_to CONFIG["admin_contact"], "webmaster", :encode => "hex" %> with the following pieces of information:</p>
|
||||
<p>If you believe a post infringes upon your copyright, please send an email to the <%= mail_to Danbooru.config.contact_email, "webmaster", :encode => "hex" %> with the following pieces of information:</p>
|
||||
<ul>
|
||||
<li>The URL of the infringing post.</li>
|
||||
<li>Proof that you own the copyright.</li>
|
||||
|
||||
@@ -11,8 +11,9 @@ module Danbooru
|
||||
config.active_record.schema_format = :sql
|
||||
config.filter_parameters << :password
|
||||
config.action_view.javascript_expansions[:defaults] = [
|
||||
"src/lib/jquery-1.5.1.min.js",
|
||||
"src/lib/jquery-1.6.0.min.js",
|
||||
"src/lib/jquery-ui-1.8.9.custom.min.js",
|
||||
"src/lib/jquery.timeout.js",
|
||||
"src/lib/rails.js",
|
||||
"src/app/common.js",
|
||||
"src/app/cookie.js",
|
||||
@@ -27,7 +28,8 @@ module Danbooru
|
||||
"src/app/post_moderation.js",
|
||||
"src/app/pools.js",
|
||||
"src/app/wiki_pages.js",
|
||||
"src/app/forum_posts.js"
|
||||
"src/app/forum_posts.js",
|
||||
"src/app/notes.js"
|
||||
]
|
||||
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
||||
end
|
||||
|
||||
@@ -39,12 +39,19 @@ Danbooru::Application.routes.draw do
|
||||
resources :jobs
|
||||
resources :ip_bans
|
||||
resources :notes do
|
||||
collection do
|
||||
get :search
|
||||
end
|
||||
|
||||
member do
|
||||
put :revert
|
||||
end
|
||||
end
|
||||
resources :note_versions, :only => [:index]
|
||||
resources :pools do
|
||||
collection do
|
||||
get :search
|
||||
end
|
||||
member do
|
||||
put :revert
|
||||
end
|
||||
@@ -98,6 +105,7 @@ Danbooru::Application.routes.draw do
|
||||
match "/terms_of_service" => "static#terms_of_service", :as => "terms_of_service"
|
||||
match "/user_maintenance/login_reminder" => "user_maintenance#login_reminder", :as => "login_reminder"
|
||||
match "/user_maintenance/reset_password" => "user_maintenance#reset_password", :as => "reset_password"
|
||||
match '/jquery_test' => 'static#jquery_test'
|
||||
|
||||
root :to => "posts#index"
|
||||
end
|
||||
|
||||
16
public/javascripts/src/lib/jquery.min.js
vendored
16
public/javascripts/src/lib/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
1
public/javascripts/src/lib/jrails.min.js
vendored
1
public/javascripts/src/lib/jrails.min.js
vendored
@@ -1 +0,0 @@
|
||||
(function($){$.ajaxSettings.accepts._default="text/javascript, text/html, application/xml, text/xml, */*"})(jQuery);(function($){$.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(){return this.each(function(){this.disabled=false})};$.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function($){$.extend({fieldEvent:function(el,obs){var field=el[0]||el,e="change";if(field.type=="radio"||field.type=="checkbox"){e="click"}else{if(obs&&(field.type=="text"||field.type=="textarea"||field.type=="password")){e="keyup"}}return e}});$.fn.extend({delayedObserver:function(delay,callback){var el=$(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(stackPos){var observed=window.delayedObserverStack[stackPos];if(observed.timer){clearTimeout(observed.timer)}observed.timer=setTimeout(function(){observed.timer=null;observed.callback(observed.obj,observed.obj.formVal())},observed.delay*1000);observed.oldVal=observed.obj.formVal()}}window.delayedObserverStack.push({obj:el,timer:null,delay:delay,oldVal:el.formVal(),callback:callback});var stackPos=window.delayedObserverStack.length-1;if(el[0].tagName=="FORM"){$(":input",el).each(function(){var field=$(this);field.bind($.fieldEvent(field,delay),function(){var observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.oldVal){return}else{window.delayedObserverCallback(stackPos)}})})}else{el.bind($.fieldEvent(el,delay),function(){var observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.oldVal){return}else{window.delayedObserverCallback(stackPos)}})}},formVal:function(){var el=this[0];if(el.tagName=="FORM"){return this.serialize()}if(el.type=="checkbox"||el.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o,options){if(options){speed=options.duration*1000}else{speed=null}e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"("+speed+")")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},slideUp:function(speed,callback){return this.hide("slide",{direction:"up"},speed,callback)},slideDown:function(speed,callback){return this.show("slide",{direction:"up"},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery);
|
||||
@@ -3,11 +3,7 @@
|
||||
|
||||
body, div, h1, h2, h3, h4, h5, h6, p, ul, li, dd, dt, header, aside {
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
line-height: 1.25em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
vertical-align: baseline; }
|
||||
line-height: 1.25em; }
|
||||
|
||||
body {
|
||||
font-size: 87.5%; }
|
||||
@@ -504,3 +500,51 @@ div#c-post-moderation aside {
|
||||
div#c-post-moderation section {
|
||||
float: left;
|
||||
width: 300px; }
|
||||
|
||||
/*** Note Container ***/
|
||||
div#note-container {
|
||||
position: absolute; }
|
||||
div#note-container div.note-body {
|
||||
background: #FFE;
|
||||
border: 1px solid black;
|
||||
max-width: 300px;
|
||||
min-width: 140px;
|
||||
min-height: 10px;
|
||||
position: absolute;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
overflow: auto; }
|
||||
div#note-container div.note-body p.tn {
|
||||
font-size: 0.8em;
|
||||
color: gray; }
|
||||
div#note-container div.note-box {
|
||||
position: absolute;
|
||||
border: 1px solid black;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
cursor: move;
|
||||
background: #FFE; }
|
||||
div#note-container div.note-box div.note-corner {
|
||||
background: black;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
cursor: se-resize; }
|
||||
div#note-container div.unsaved {
|
||||
background: #FFF;
|
||||
border: 1px solid red; }
|
||||
div#note-container div.unsaved div.note-corner {
|
||||
background: red; }
|
||||
|
||||
div#jquery-test div.note {
|
||||
background: #FFE;
|
||||
border: 1px solid black;
|
||||
max-width: 300px;
|
||||
min-width: 140px;
|
||||
min-height: 10px;
|
||||
position: absolute;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
overflow: auto; }
|
||||
|
||||
@@ -8,10 +8,6 @@ $link_hover_color: #9093FF;
|
||||
body, div, h1, h2, h3, h4, h5, h6, p, ul, li, dd, dt, header, aside {
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
line-height: 1.25em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
body {
|
||||
@@ -860,4 +856,68 @@ div#c-post-moderation {
|
||||
float: left;
|
||||
width: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*** Note Container ***/
|
||||
div#note-container {
|
||||
position: absolute;
|
||||
|
||||
div.note-body {
|
||||
background: #FFE;
|
||||
border: 1px solid black;
|
||||
max-width: 300px;
|
||||
min-width: 140px;
|
||||
min-height: 10px;
|
||||
position: absolute;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
overflow: auto;
|
||||
|
||||
p.tn {
|
||||
font-size: 0.8em;
|
||||
color: gray;
|
||||
}
|
||||
}
|
||||
|
||||
div.note-box {
|
||||
position: absolute;
|
||||
border: 1px solid black;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
cursor: move;
|
||||
background: #FFE;
|
||||
|
||||
div.note-corner {
|
||||
background: black;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
cursor: se-resize;
|
||||
}
|
||||
}
|
||||
|
||||
div.unsaved {
|
||||
background: #FFF;
|
||||
border: 1px solid red;
|
||||
|
||||
div.note-corner {
|
||||
background: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
div#jquery-test div.note {
|
||||
background: #FFE;
|
||||
border: 1px solid black;
|
||||
max-width: 300px;
|
||||
min-width: 140px;
|
||||
min-height: 10px;
|
||||
position: absolute;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
overflow: auto;
|
||||
}
|
||||
@@ -40,7 +40,8 @@ class UserTest < ActiveSupport::TestCase
|
||||
user = Factory.create(:user)
|
||||
assert(user.can_comment_vote?)
|
||||
12.times do
|
||||
Factory.create(:comment_vote, :user => user)
|
||||
comment = Factory.create(:comment)
|
||||
Factory.create(:comment_vote, :user => user, :comment_id => comment.id)
|
||||
end
|
||||
assert(!user.can_comment_vote?)
|
||||
CommentVote.update_all("created_at = '1990-01-01'")
|
||||
|
||||
Reference in New Issue
Block a user