<div id="c-forum-topics">
  <div id="a-index">
    <h1>Forum</h1>

    <table width="100%" class="striped">
      <thead>
        <tr>
          <th>Title</th>
          <th>Creator</th>
          <th>Updated by</th>
          <th>Updated at</th>
        </tr>
      </thead>
      <tbody>
        <% @forum_topics.each do |topic| %>
          <tr class="forum-topic-row">
            <td>
              <% if topic.is_sticky? %>
                <span class="sticky">Sticky:</span>
              <% end %>

              <% if topic.updated_at > (CurrentUser.last_forum_read_at || Time.now) %>
                <span class="new">NEW</span>
              <% end %>

              <%= link_to topic.title, forum_topic_path(topic) %>

              <% if topic.response_count > Danbooru.config.posts_per_page %>
                <%= link_to "page #{topic.last_page}", forum_topic_path(topic, :page => topic.last_page), :class => "last-page" %>
              <% end %>

              <% if topic.is_locked? %>
                <span class="locked-topic">(locked)</span>
              <% end %>
            </td>
            <td><%= link_to_user topic.creator %></td>
            <td><%= link_to_user topic.updater %></td>
            <td><%= compact_time topic.updated_at %></td>
          </tr>
        <% end %>
      </tbody>
    </table>

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

<%= render "secondary_links" %>

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