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-12 01:35:42 +00:00
|
|
|
<%= render partial: 'controls', locals: { forum: @forum } %>
|
|
|
|
|
|
|
|
<h2><%=h @forum.title %></h2>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-12 01:35:42 +00:00
|
|
|
<table id="topics">
|
|
|
|
<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>
|
|
|
|
<% @forum.topics.basic.ordered.each do |topic| %>
|
|
|
|
<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
|
|
|
|
2014-04-12 01:35:42 +00:00
|
|
|
<%= link_to (h topic), topic, class: ((cuser and !topic.read_by? cuser) ? "unread" : "read") %>
|
|
|
|
</h5>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-12 01:35:42 +00:00
|
|
|
<% if topic.posts.count > Topic::POSTS_PAGE %>
|
|
|
|
Page:
|
|
|
|
<% (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>
|
|
|
|
<td><%=h topic.posts.count-1 %></td>
|
|
|
|
<td><%=h topic.view_count %></td>
|
|
|
|
<td>
|
|
|
|
<%= link_to lastpost(topic) do %>
|
|
|
|
<%=h topic.posts.last.user %><br>
|
|
|
|
<%= shortdate(topic.posts.last.created_at) %>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
2014-04-12 01:35:42 +00:00
|
|
|
</table>
|
|
|
|
|
|
|
|
<%= render partial: 'controls', locals: { forum: @forum } %>
|