hide deleted forum posts in search

This commit is contained in:
r888888888
2015-06-18 16:41:31 -07:00
parent 47ec1ca55d
commit 7754d72a51

View File

@@ -11,17 +11,19 @@
</thead>
<tbody>
<% @forum_posts.each do |forum_post| %>
<tr>
<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) %>
<% if forum_post.is_deleted? %>
(deleted)
<% end %>
</td>
<td><%= link_to_user forum_post.creator %></td>
<td><%= time_ago_in_words_tagged forum_post.created_at %></td>
</tr>
<% if CurrentUser.is_janitor? || !forum_post.is_deleted? %>
<tr>
<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) %>
<% if forum_post.is_deleted? %>
(deleted)
<% end %>
</td>
<td><%= link_to_user forum_post.creator %></td>
<td><%= time_ago_in_words_tagged forum_post.created_at %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>