discourse/app/views/categories/index.html.erb
Robin Ward 560fb15d8a Include pinned topics in category list.
- removes an (n+1) query for user data
- supports the preload store for the data to avoid a second request
- fix a bug where uncategorizes was reporting (0, 0, 0) for topics by week, month, year
2013-05-28 15:36:16 -04:00

14 lines
496 B
Plaintext

<% @list.categories.each do |c| %>
<div class="category">
<h2><a href="/category/<%= c.slug.blank? ? c.id : c.slug %>"><%= c.name %></a></h2>
<div class="topic-list">
<%- if c.displayable_topics.present? %>
<% c.displayable_topics.each do |t| %>
<a href="<%= t.relative_url %>"><%= t.title %></a> <span title='<%= t 'posts' %>'>(<%= t.posts_count %>)</span><br/>
<% end %>
<%- end %>
</div>
</div>
<% end %>
<p><%= t 'powered_by_html' %></p>