Avoid doing one SQL query per topic when checking for new topics on the forum index. This also changes it so that forum topics aren't always marked as new for anonymous users.
27 lines
836 B
Plaintext
27 lines
836 B
Plaintext
<div id="c-forum-topics">
|
|
<div id="a-index">
|
|
<h1>Forum</h1>
|
|
|
|
<p>
|
|
Categories:
|
|
<%= link_to "All", forum_topics_path %>,
|
|
<% if CurrentUser.is_moderator? %>
|
|
<%= link_to "Mod+", forum_topics_path(:search => {:mod_only => true}) %>,
|
|
<% end %>
|
|
<%= ForumTopic::CATEGORIES.map {|id, name| link_to_unless_current(name, forum_topics_path(:search => {:category_id => id}))}.join(", ").html_safe %>
|
|
</p>
|
|
|
|
<%= render "listing", forum_topics: @forum_topics, read_forum_topics: @read_forum_topics %>
|
|
|
|
<%= numbered_paginator(@forum_topics) %>
|
|
</div>
|
|
</div>
|
|
|
|
<%= render "secondary_links" %>
|
|
|
|
<% content_for(:page_title) do %>
|
|
Forum - <%= Danbooru.config.app_name %>
|
|
<% end %>
|
|
|
|
<% content_for(:html_header, auto_discovery_link_tag(:atom, forum_topics_url(:atom), title: "Forum Topics")) %>
|