fixes #1080
This commit is contained in:
@@ -16,11 +16,11 @@ class ForumPostsController < ApplicationController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
if CurrentUser.is_janitor?
|
if CurrentUser.is_janitor?
|
||||||
@search = ForumPost.search(params[:search])
|
@query = ForumPost.search(params[:search])
|
||||||
else
|
else
|
||||||
@search = ForumPost.active.search(params[:search])
|
@query = ForumPost.active.search(params[:search])
|
||||||
end
|
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|
|
respond_with(@forum_posts) do |format|
|
||||||
format.xml do
|
format.xml do
|
||||||
render :xml => @forum_posts.to_xml(:root => "forum-posts")
|
render :xml => @forum_posts.to_xml(:root => "forum-posts")
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ class ForumTopicsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@search = ForumTopic.active.search(params[:search])
|
@query = 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])
|
@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|
|
respond_with(@forum_topics) do |format|
|
||||||
format.xml do
|
format.xml do
|
||||||
render :xml => @forum_topics.to_xml(:root => "forum-topics")
|
render :xml => @forum_topics.to_xml(:root => "forum-topics")
|
||||||
|
|||||||
3
app/views/forum_posts/_quick_search.html.erb
Normal file
3
app/views/forum_posts/_quick_search.html.erb
Normal 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 %>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<% content_for(:secondary_links) do %>
|
<% content_for(:secondary_links) do %>
|
||||||
<menu>
|
<menu>
|
||||||
|
<li><%= render "forum_posts/quick_search" %></li>
|
||||||
<li><%= link_to "Listing", forum_topics_path %></li>
|
<li><%= link_to "Listing", forum_topics_path %></li>
|
||||||
|
|
||||||
<% if CurrentUser.is_member? %>
|
<% if CurrentUser.is_member? %>
|
||||||
|
|||||||
@@ -3,15 +3,13 @@
|
|||||||
<h1>Search User Feedbacks</h1>
|
<h1>Search User Feedbacks</h1>
|
||||||
|
|
||||||
<%= form_tag(user_feedbacks_path, :method => :get, :class => "simple_form") do %>
|
<%= 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">
|
<div class="input">
|
||||||
<%= search_field "user_name", :label => "User" %>
|
<label for="search_category">Category</label>
|
||||||
|
<%= select "search", "category", %w(positive negative neutral), :include_blank => true %>
|
||||||
<%= 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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<% content_for(:secondary_links) do %>
|
<% content_for(:secondary_links) do %>
|
||||||
<menu>
|
<menu>
|
||||||
<li><%= render "users/quick_search" %>
|
<li><%= render "users/quick_search" %></li>
|
||||||
<li><%= link_to "Listing", users_path %></li>
|
<li><%= link_to "Listing", users_path %></li>
|
||||||
<li><%= link_to "Search", search_users_path %></li>
|
<li><%= link_to "Search", search_users_path %></li>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user