From 56fa98a35803c3e1c86abb4a12dd0de742cfd0fc Mon Sep 17 00:00:00 2001 From: Toks Date: Sun, 4 Aug 2013 11:34:20 -0400 Subject: [PATCH] Add flag and appeal searches #1915 --- app/controllers/post_appeals_controller.rb | 4 +-- app/controllers/post_flags_controller.rb | 4 +-- app/views/post_appeals/_search.html.erb | 27 +++++++++++++++ app/views/post_appeals/index.html.erb | 1 + app/views/post_flags/_search.html.erb | 38 ++++++++++++++++++++++ app/views/post_flags/index.html.erb | 1 + 6 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 app/views/post_appeals/_search.html.erb create mode 100644 app/views/post_flags/_search.html.erb diff --git a/app/controllers/post_appeals_controller.rb b/app/controllers/post_appeals_controller.rb index aa90dab1c..139f46621 100644 --- a/app/controllers/post_appeals_controller.rb +++ b/app/controllers/post_appeals_controller.rb @@ -8,8 +8,8 @@ class PostAppealsController < ApplicationController end def index - @search = PostAppeal.order("id desc").search(params[:search]) - @post_appeals = @search.paginate(params[:page], :limit => params[:limit]) + @query = PostAppeal.order("id desc").search(params[:search]) + @post_appeals = @query.paginate(params[:page], :limit => params[:limit]) respond_with(@post_appeals) do |format| format.xml do render :xml => @post_appeals.to_xml(:root => "post-appeals") diff --git a/app/controllers/post_flags_controller.rb b/app/controllers/post_flags_controller.rb index 58f358a45..0c99893ec 100644 --- a/app/controllers/post_flags_controller.rb +++ b/app/controllers/post_flags_controller.rb @@ -8,8 +8,8 @@ class PostFlagsController < ApplicationController end def index - @search = PostFlag.order("id desc").search(params[:search]) - @post_flags = @search.paginate(params[:page], :limit => params[:limit]) + @query = PostFlag.order("id desc").search(params[:search]) + @post_flags = @query.paginate(params[:page], :limit => params[:limit]) respond_with(@post_flags) do |format| format.xml do render :xml => @post_flags.to_xml(:root => "post-flags") diff --git a/app/views/post_appeals/_search.html.erb b/app/views/post_appeals/_search.html.erb new file mode 100644 index 000000000..b18b08298 --- /dev/null +++ b/app/views/post_appeals/_search.html.erb @@ -0,0 +1,27 @@ + + + <%= form_tag(post_flags_path, :method => :get, :class => "simple_form") do %> + + + + + + + + + + + + + <% end %> + + diff --git a/app/views/post_appeals/index.html.erb b/app/views/post_appeals/index.html.erb index 8689c33e5..61fa060c2 100644 --- a/app/views/post_appeals/index.html.erb +++ b/app/views/post_appeals/index.html.erb @@ -1,6 +1,7 @@

Appeals

+ <%= render "search" %> diff --git a/app/views/post_flags/_search.html.erb b/app/views/post_flags/_search.html.erb new file mode 100644 index 000000000..ae436aec0 --- /dev/null +++ b/app/views/post_flags/_search.html.erb @@ -0,0 +1,38 @@ +
+ + <%= form_tag(post_flags_path, :method => :get, :class => "simple_form") do %> + + + + + + <% if CurrentUser.user.is_janitor? %> + + + + + <% end %> + + + + + + + + + <% end %> + + diff --git a/app/views/post_flags/index.html.erb b/app/views/post_flags/index.html.erb index a87192386..6eb6b62ba 100644 --- a/app/views/post_flags/index.html.erb +++ b/app/views/post_flags/index.html.erb @@ -1,6 +1,7 @@

Flags

+ <%= render "search" %>