indicating locked thread at bottom, asking to log in before reply

This commit is contained in:
jomo
2014-10-12 21:46:29 +02:00
parent b91bb8e0aa
commit 36792c6dc1
3 changed files with 24 additions and 4 deletions

View File

@@ -24,10 +24,21 @@
<% @replies.each do |reply| %>
<%= render partial: "threadreplies/reply", locals: {reply: reply} %>
<% end %>
<%= paginate @replies %>
<% if @thread.can_write?(current_user) %>
<%= render partial: "threadreplies/new", locals: {reply: Threadreply.new(forumthread: @thread)} %>
<% if @thread.locked? %>
<div class="locked">This thread is locked.</div>
<% end %>
<% if current_user %>
<% if @thread.can_write?(current_user) %>
<%= render partial: "threadreplies/new", locals: {reply: Threadreply.new(forumthread: @thread)} %>
<% else %>
<p>You don't have the required permission to reply here.</p>
<% end %>
<% else %>
You cannot reply here.
<p>Please <%= link_to "Log in", login_path(return_path: request.env['PATH_INFO']), action: "new" %> to post a reply.</p>
<% end %>
</div>