diff --git a/app/controllers/forum_posts_controller.rb b/app/controllers/forum_posts_controller.rb index 9008c48a6..680470220 100644 --- a/app/controllers/forum_posts_controller.rb +++ b/app/controllers/forum_posts_controller.rb @@ -16,11 +16,11 @@ class ForumPostsController < ApplicationController def index if CurrentUser.is_janitor? - @search = ForumPost.search(params[:search]) + @query = ForumPost.search(params[:search]) else - @search = ForumPost.active.search(params[:search]) + @query = ForumPost.active.search(params[:search]) end - @forum_posts = @search.order("forum_posts.id DESC").paginate(params[:page], :limit => params[:limit], :search_count => params[:search]) + @forum_posts = @query.order("forum_posts.id DESC").paginate(params[:page], :limit => params[:limit], :search_count => params[:search]) respond_with(@forum_posts) do |format| format.xml do render :xml => @forum_posts.to_xml(:root => "forum-posts") diff --git a/app/controllers/forum_topics_controller.rb b/app/controllers/forum_topics_controller.rb index 54ec8649b..d938308f6 100644 --- a/app/controllers/forum_topics_controller.rb +++ b/app/controllers/forum_topics_controller.rb @@ -17,8 +17,8 @@ class ForumTopicsController < ApplicationController end def index - @search = ForumTopic.active.search(params[:search]) - @forum_topics = @search.order("is_sticky DESC, updated_at DESC").paginate(params[:page], :limit => params[:limit], :search_count => params[:search]) + @query = ForumTopic.active.search(params[:search]) + @forum_topics = @query.order("is_sticky DESC, updated_at DESC").paginate(params[:page], :limit => params[:limit], :search_count => params[:search]) respond_with(@forum_topics) do |format| format.xml do render :xml => @forum_topics.to_xml(:root => "forum-topics") diff --git a/app/views/forum_posts/_quick_search.html.erb b/app/views/forum_posts/_quick_search.html.erb new file mode 100644 index 000000000..8b830b1e7 --- /dev/null +++ b/app/views/forum_posts/_quick_search.html.erb @@ -0,0 +1,3 @@ +<%= form_tag(forum_posts_path, :method => :get) do %> + <%= text_field "search", "body_matches", :id => "quick_search_body_matches", :placeholder => "Search forum" %> +<% end %> diff --git a/app/views/forum_topics/_secondary_links.html.erb b/app/views/forum_topics/_secondary_links.html.erb index 0e23b7ff3..45942094e 100644 --- a/app/views/forum_topics/_secondary_links.html.erb +++ b/app/views/forum_topics/_secondary_links.html.erb @@ -1,5 +1,6 @@ <% content_for(:secondary_links) do %>