54 lines
2.1 KiB
Plaintext
54 lines
2.1 KiB
Plaintext
<%= link_to @forum.group, forumgroup_path(@forum.group) %> → <%= @forum %>
|
|
|
|
<h1><%= title @forum %></h1>
|
|
<% if @forum.can_write?(current_user) %>
|
|
<p><%= link_to "New thread", new_forumthread_path(forum: @forum), class: "btn blue" %></p>
|
|
<% end %>
|
|
|
|
<% if @forum.role_read && @forum.role_write && @forum.role_write < @forum.role_read %>
|
|
<div class="lockednote">
|
|
<% 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 %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div id="forum_groups">
|
|
<% @threads.each do |thread| %>
|
|
<div class="item-group with-avatar" id="thread-<%= thread.id %>">
|
|
<div class="header">
|
|
<%= 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 %>
|
|
<span class="comment-counter">
|
|
<%= link_to pluralize(thread.replies.count, "Reply"), thread %>
|
|
</span>
|
|
<div class="clear-right"></div>
|
|
</div>
|
|
<div class="items bold">
|
|
<div class="item <%= "#{"locked" if thread.locked}#{"sticky" if thread.sticky}" %>">
|
|
<%= render partial: "labels/label", locals: {label: thread.label} %><%= link_to truncate(thread.title, length: 60, omission: " …"), forumthread_path(thread), title: thread.title %>
|
|
<div class="item-info">
|
|
<% 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 %>
|
|
</div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<%= paginate @threads %>
|
|
</div> |