<%= link_to @forum.group, forumgroup_path(@forum.group) %> → <%= @forum %>

<%= title @forum %>

<% if @forum.can_write?(current_user) %>

<%= link_to "New thread", new_forumthread_path(forum: @forum), class: "btn blue" %>

<% end %> <% if @forum.role_read && @forum.role_write && @forum.role_write < @forum.role_read %>
<% if @forum.role_read > current_user.role %> This forum is write-only. You can only see your own posts. <% else %> This forum is write-only for users ranked under <%= @forum.role_read %>. They can only see their own posts. <% end %>
<% end %>
<% @threads.each do |thread| %>
<%= link_to(thread.author.avatar(64), thread.author, title: thread.author.ign) %> <%= render partial: "users/username", locals: { user: thread.author } %> <%= link_to thread do %> <%= ago thread.created_at %> <% end %> <%= link_to pluralize(thread.replies.count, "Reply"), thread %>
"> <%= render partial: "labels/label", locals: {label: thread.label} %><%= link_to truncate(thread.title, length: 60, omission: " …"), forumthread_path(thread), title: thread.title %>
<% if rpl = thread.replies.last %> <%= rpl.author.name %> <% position = thread.replies.count - 1 page = position / Kaminari.config.default_per_page + 1 %> <%= link_to "replied", forumthread_path(thread, page: page) + "#reply-#{rpl.id}" %> <%= ago rpl.created_at %>. <% else %> No replies yet. <% end %>
<% end %> <%= paginate @threads %>