This commit is contained in:
Toks 2013-07-07 19:29:24 -04:00
parent fc3aac28b8
commit 39a6cca62a
6 changed files with 16 additions and 14 deletions

View File

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

View File

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

View File

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

View File

@ -1,5 +1,6 @@
<% content_for(:secondary_links) do %>
<menu>
<li><%= render "forum_posts/quick_search" %></li>
<li><%= link_to "Listing", forum_topics_path %></li>
<% if CurrentUser.is_member? %>

View File

@ -3,15 +3,13 @@
<h1>Search User Feedbacks</h1>
<%= form_tag(user_feedbacks_path, :method => :get, :class => "simple_form") do %>
<%= search_field "user_name", :label => "User" %>
<%= search_field "creator_name", :label => "Creator" %>
<div class="input">
<%= search_field "user_name", :label => "User" %>
<%= search_field "creator_name", :label => "Creator" %>
<div class="input">
<label for="search_category">Category</label>
<%= select "search", "category", %w(positive negative neutral), :include_blank => true %>
</div>
<label for="search_category">Category</label>
<%= select "search", "category", %w(positive negative neutral), :include_blank => true %>
</div>
<div class="input">

View File

@ -1,6 +1,6 @@
<% content_for(:secondary_links) do %>
<menu>
<li><%= render "users/quick_search" %>
<li><%= render "users/quick_search" %></li>
<li><%= link_to "Listing", users_path %></li>
<li><%= link_to "Search", search_users_path %></li>