when the role-write is lower than the role-read, a forum is considered write-only for anyone who can write, but not read, they can create posts, but they can only see and reply to their own posts. users who can read are able to see and reply to all posts in the forum.
44 lines
1.8 KiB
Plaintext
44 lines
1.8 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">This forum is write-only. You can only see your own posts.</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 %>
|
|
<%= link_to "replied", forumthread_path(thread) + "#reply-#{rpl.id}" %>
|
|
<%= ago rpl.created_at %>.
|
|
<% else %>
|
|
No replies yet.
|
|
<% end %>
|
|
</div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<%= paginate @threads %>
|
|
</div> |