<%= table_for forum_topics, width: "100%" do |t| %>
  <% t.column "Title" do |topic| %>
    <% if !topic.is_read? %>
      <%= link_to forum_topics_path(search: { is_read: false }) do %>
        <span class="topic-status label new">New</span>
      <% end %>
    <% end %>

    <% if topic.is_sticky? %>
      <%= link_to forum_topics_path(search: { is_sticky: true }) do %>
        <%= sticky_icon(class: "topic-status stickied", title: "Stickied") %>
      <% end %>
    <% end %>

    <% if topic.is_locked? %>
      <%= link_to forum_topics_path(search: { is_locked: true }) do %>
        <%= lock_icon(class: "topic-status locked", title: "Locked") %>
      <% end %>
    <% end %>

    <% if topic.is_deleted? %>
      <%= link_to forum_topics_path(search: { is_deleted: true }) do %>
        <%= delete_icon(class: "topic-status deleted", title: "Deleted") %>
      <% end %>
    <% end %>

    <% if topic.is_private? %>
      <%= link_to forum_topics_path(search: { is_private: true }) do %>
        <%= private_icon(class: "topic-status private", title: "#{User.level_string(topic.min_level)} only") %>
      <% end %>
    <% end %>

    <% if forum_topic_status(topic).present? %>
      <%= link_to topic.pretty_title, forum_topic_path(topic), class: "forum-post-link" %>
    <% else %>
      <%= link_to topic.title, forum_topic_path(topic), class: "forum-post-link" %>
    <% end %>

    <% 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 %>
  <% end %>
  <% t.column "Status", width: "1%" do |topic| %>
    <% status = forum_topic_status(topic) %>
    <%= link_to forum_topics_path(search: { status: status }) do %>
      <span class="topic-status label <%= status %>"><%= status %></span>
    <% end %>
  <% end %>
  <% t.column "Creator", width: "8%" do |topic| %>
    <%= link_to_user topic.creator %>
  <% end %>
  <% t.column "Updated by", width: "8%" do |topic| %>
    <%= link_to_user topic.updater %>
  <% end %>
  <% t.column "Updated at", width: "8%" do |topic| %>
    <%= compact_time topic.updated_at %>
  <% end %>
<% end %>
