fixes #1118
This commit is contained in:
@@ -16,7 +16,11 @@ class ForumPostsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@search = ForumPost.active.search(params[:search])
|
if CurrentUser.is_janitor?
|
||||||
|
@search = ForumPost.search(params[:search])
|
||||||
|
else
|
||||||
|
@search = ForumPost.active.search(params[:search])
|
||||||
|
end
|
||||||
@forum_posts = @search.order("forum_posts.id DESC").paginate(params[:page], :search_count => params[:search])
|
@forum_posts = @search.order("forum_posts.id DESC").paginate(params[:page], :search_count => params[:search])
|
||||||
respond_with(@forum_posts) do |format|
|
respond_with(@forum_posts) do |format|
|
||||||
format.xml do
|
format.xml do
|
||||||
|
|||||||
@@ -13,7 +13,12 @@
|
|||||||
<% @forum_posts.each do |forum_post| %>
|
<% @forum_posts.each do |forum_post| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= link_to forum_post.topic.title, forum_topic_path(forum_post.topic) %></td>
|
<td><%= link_to forum_post.topic.title, forum_topic_path(forum_post.topic) %></td>
|
||||||
<td><%= link_to truncate(forum_post.body, :length => 50), forum_post_path(forum_post) %></td>
|
<td>
|
||||||
|
<%= link_to truncate(forum_post.body, :length => 50), forum_post_path(forum_post) %>
|
||||||
|
<% if forum_post.is_deleted? %>
|
||||||
|
(deleted)
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
<td><%= link_to_user forum_post.creator %></td>
|
<td><%= link_to_user forum_post.creator %></td>
|
||||||
<td><%= time_ago_in_words_tagged forum_post.created_at %></td>
|
<td><%= time_ago_in_words_tagged forum_post.created_at %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user