<div id="c-forum-posts">
  <div id="a-index">
    <table width="100%" class="striped">
      <thead>
        <tr>
          <th>Topic</th>
          <th>Excerpt</th>
          <th>Creator</th>
          <th>Date</th>
        </tr>
      </thead>
      <tbody>
        <% @forum_posts.each do |forum_post| %>
          <% if CurrentUser.is_moderator? || !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>

    <%= numbered_paginator(@forum_posts) %>
  </div>
</div>

<%= render "forum_topics/secondary_links" %>

<% content_for(:page_title) do %>
  Forum Posts - <%= Danbooru.config.app_name %>
<% end %>
