From 7754d72a511282a35c3f3e704f02069677178120 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Thu, 18 Jun 2015 16:41:31 -0700 Subject: [PATCH] hide deleted forum posts in search --- app/views/forum_posts/index.html.erb | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/views/forum_posts/index.html.erb b/app/views/forum_posts/index.html.erb index b1503575a..32644f531 100644 --- a/app/views/forum_posts/index.html.erb +++ b/app/views/forum_posts/index.html.erb @@ -11,17 +11,19 @@ <% @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) %> - <% if forum_post.is_deleted? %> - (deleted) - <% end %> - - <%= link_to_user forum_post.creator %> - <%= time_ago_in_words_tagged forum_post.created_at %> - + <% if CurrentUser.is_janitor? || !forum_post.is_deleted? %> + + <%= 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) %> + <% if forum_post.is_deleted? %> + (deleted) + <% end %> + + <%= link_to_user forum_post.creator %> + <%= time_ago_in_words_tagged forum_post.created_at %> + + <% end %> <% end %>