From 3ef06e555bfa7c3fdb019bb17b88dab4024359a2 Mon Sep 17 00:00:00 2001 From: Toks Date: Mon, 22 Apr 2013 22:03:48 -0400 Subject: [PATCH] fixes #1118 --- app/controllers/forum_posts_controller.rb | 6 +++++- app/views/forum_posts/index.html.erb | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/controllers/forum_posts_controller.rb b/app/controllers/forum_posts_controller.rb index e67920828..57b44eb98 100644 --- a/app/controllers/forum_posts_controller.rb +++ b/app/controllers/forum_posts_controller.rb @@ -16,7 +16,11 @@ class ForumPostsController < ApplicationController end 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]) respond_with(@forum_posts) do |format| format.xml do diff --git a/app/views/forum_posts/index.html.erb b/app/views/forum_posts/index.html.erb index e9484f24d..b1503575a 100644 --- a/app/views/forum_posts/index.html.erb +++ b/app/views/forum_posts/index.html.erb @@ -13,7 +13,12 @@ <% @forum_posts.each do |forum_post| %> <%= link_to forum_post.topic.title, forum_topic_path(forum_post.topic) %> - <%= link_to truncate(forum_post.body, :length => 50), forum_post_path(forum_post) %> + + <%= link_to truncate(forum_post.body, :length => 50), forum_post_path(forum_post) %> + <% if forum_post.is_deleted? %> + (deleted) + <% end %> + <%= link_to_user forum_post.creator %> <%= time_ago_in_words_tagged forum_post.created_at %>