2014-05-02 16:43:23 +00:00
|
|
|
<%= provide :content_class, 'no-body' %>
|
|
|
|
|
2014-04-12 01:35:42 +00:00
|
|
|
<div class="breadcrumbs">
|
|
|
|
<%= link_to "Forums", action: "index" %> <%= icon 'chevron-right' %> <%= namelink @forum %>
|
|
|
|
</div>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-29 23:34:48 +00:00
|
|
|
<div class="topic-controls">
|
|
|
|
<%= render partial: 'controls', locals: { forum: @forum } %>
|
|
|
|
</div>
|
2014-04-12 01:35:42 +00:00
|
|
|
|
|
|
|
<h2><%=h @forum.title %></h2>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-13 11:16:51 +00:00
|
|
|
<%= will_paginate @topics %>
|
|
|
|
|
2014-04-29 18:18:14 +00:00
|
|
|
<table id="topics" class="striped">
|
2014-05-02 16:43:23 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="topic">Topic</th>
|
|
|
|
<th class="author">Author</th>
|
|
|
|
<th class="replies">Replies</th>
|
|
|
|
<th class="views">Views</th>
|
|
|
|
<th class="last">Last Post</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
2014-04-13 11:16:51 +00:00
|
|
|
<% @topics.each do |topic| %>
|
2014-04-12 01:35:42 +00:00
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<h5>
|
|
|
|
<% if topic.state == Topic::STATE_STICKY %>
|
|
|
|
<b>Sticky: </b>
|
|
|
|
<% elsif topic.lock %>
|
|
|
|
<b>Locked: </b>
|
|
|
|
<% end %>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2015-04-09 17:23:29 +00:00
|
|
|
<%= link_to (h topic), topic,
|
|
|
|
class: ((cuser and !topic.read_by? cuser) ? "unread" : "read") +
|
|
|
|
((topic.state == Topic::STATE_STICKY) ? " sticky" : "") %>
|
2014-04-12 01:35:42 +00:00
|
|
|
</h5>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-12 01:35:42 +00:00
|
|
|
<% if topic.posts.count > Topic::POSTS_PAGE %>
|
2015-04-09 17:23:29 +00:00
|
|
|
Page:
|
2014-04-12 01:35:42 +00:00
|
|
|
<% (1..((topic.posts.count/Topic::POSTS_PAGE).ceil + 1)).to_a.each do |page| %>
|
|
|
|
<%= ", " unless page == 1 %>
|
|
|
|
<%= link_to page, topic_url(topic, page: page) %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
<td><%= namelink(topic.user) %></td>
|
2014-04-13 11:16:51 +00:00
|
|
|
<td><%=h topic.cached_posts_count %></td>
|
|
|
|
<td><%=h topic.cached_view_count %></td>
|
2014-04-12 01:35:42 +00:00
|
|
|
<td>
|
|
|
|
<%= link_to lastpost(topic) do %>
|
2014-06-06 20:27:52 +00:00
|
|
|
<%=h topic.latest.user %><br>
|
|
|
|
<%= shortdate(topic.latest.created_at) %>
|
2014-04-12 01:35:42 +00:00
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
2014-04-12 01:35:42 +00:00
|
|
|
</table>
|
|
|
|
|
2014-04-13 11:16:51 +00:00
|
|
|
<%= will_paginate @topics %>
|
|
|
|
|
2014-04-12 01:35:42 +00:00
|
|
|
<%= render partial: 'controls', locals: { forum: @forum } %>
|