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 %> +
  • <%= render "forum_posts/quick_search" %>
  • <%= link_to "Listing", forum_topics_path %>
  • <% if CurrentUser.is_member? %> diff --git a/app/views/user_feedbacks/search.html.erb b/app/views/user_feedbacks/search.html.erb index 7203c8058..615446776 100644 --- a/app/views/user_feedbacks/search.html.erb +++ b/app/views/user_feedbacks/search.html.erb @@ -3,15 +3,13 @@

    Search User Feedbacks

    <%= form_tag(user_feedbacks_path, :method => :get, :class => "simple_form") do %> + <%= search_field "user_name", :label => "User" %> + + <%= search_field "creator_name", :label => "Creator" %> +
    - <%= search_field "user_name", :label => "User" %> - - <%= search_field "creator_name", :label => "Creator" %> - -
    - - <%= select "search", "category", %w(positive negative neutral), :include_blank => true %> -
    + + <%= select "search", "category", %w(positive negative neutral), :include_blank => true %>
    diff --git a/app/views/users/_secondary_links.html.erb b/app/views/users/_secondary_links.html.erb index 3cd6bdb62..f65559561 100644 --- a/app/views/users/_secondary_links.html.erb +++ b/app/views/users/_secondary_links.html.erb @@ -1,6 +1,6 @@ <% content_for(:secondary_links) do %> -
  • <%= render "users/quick_search" %> +
  • <%= render "users/quick_search" %>
  • <%= link_to "Listing", users_path %>
  • <%= link_to "Search", search_users_path %>