%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → <%=truncate(@thread.title, length: 60, omission: " …") %>
<%= "#{pluralize(@thread.replies.size, 'reply')}." %>
<% @replies.each do |reply| %>
<%= render partial: "threadreplies/reply", locals: {reply: reply} %>
<% end %>
<%= paginate @replies %>
<% if @thread.locked? %>
This thread is locked.
<% end %>
<% if current_user %>
<% if @thread.can_write?(current_user) %>
<%= render partial: "threadreplies/new", locals: {reply: Threadreply.new(forumthread: @thread)} %>
<% else %>
You don't have the required permission to reply here.
<% end %>
<% else %>
Please <%= link_to "Log in", login_path(return_path: request.env['PATH_INFO']), action: "new" %> to post a reply.
<% end %>