* Added note version controller and test
* Added pool version controller and test * Refactored unit tests for post disapprovals * Renamed PostModerationDetail to PostDisapproval
This commit is contained in:
10
app/controllers/note_versions_controller.rb
Normal file
10
app/controllers/note_versions_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class NoteVersionsController < ApplicationController
|
||||
respond_to :html, :xml, :json
|
||||
before_filter :member_only, :except => [:index, :show]
|
||||
|
||||
def index
|
||||
@search = NoteVersion.search(params[:search])
|
||||
@note_versions = @search.paginate(:page => params[:page])
|
||||
respond_with(@note_versions)
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,6 @@
|
||||
class PoolVersionsController < ApplicationController
|
||||
def index
|
||||
@search = PoolVersion.search(params[:search])
|
||||
@pool_versions = @search.paginate(:page => params[:page])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
class PostModerationController < ApplicationController
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
respond_to :html, :xml, :json
|
||||
before_filter :janitor_only
|
||||
|
||||
def moderate
|
||||
@search = Post.pending.available_for_moderation.search(params[:search]).order("id asc")
|
||||
@posts = @search.paginate(:page => params[:page])
|
||||
respond_with(@posts)
|
||||
end
|
||||
|
||||
def update
|
||||
def approve
|
||||
@post = Post.find(params[:post_id])
|
||||
@post.approve!
|
||||
respond_with(@post, :location => post_moderation_moderate_path)
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
def disapprove
|
||||
@post = Post.find(params[:post_id])
|
||||
@post_disapproval = PostDisapproval.create(:post => @post, :user => CurrentUser.user)
|
||||
respond_with(@post_disapproval, :location => post_moderation_moderate_path)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user