fixed comment test

This commit is contained in:
albert
2011-05-16 09:27:06 -04:00
parent 903a3fa5d1
commit 158810d9f0
20 changed files with 174 additions and 58 deletions

View File

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

View File

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

View File

@@ -1,2 +1,4 @@
class StaticController < ApplicationController
def jquery_test
end
end

View File

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

View File

@@ -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])}

View File

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

View File

@@ -1,5 +0,0 @@
<div id="c-notes">
<div id="a-index">
</div>
</div>

View File

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

View File

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

View File

@@ -1,7 +1,5 @@
<div id="c-pools">
<div id="a-index">
<%= render "search" %>
<table class="striped" width="100%">
<thead>
<tr>

View File

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

View File

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

View File

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