Archived
indicating locked thread at bottom, asking to log in before reply
This commit is contained in:
@@ -962,3 +962,12 @@ nav.pagination {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.locked {
|
||||||
|
background: #ffa500;
|
||||||
|
border: 1px solid;
|
||||||
|
border-radius: 3px;
|
||||||
|
color: #000;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 2px 5px;
|
||||||
|
}
|
||||||
@@ -24,10 +24,21 @@
|
|||||||
<% @replies.each do |reply| %>
|
<% @replies.each do |reply| %>
|
||||||
<%= render partial: "threadreplies/reply", locals: {reply: reply} %>
|
<%= render partial: "threadreplies/reply", locals: {reply: reply} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= paginate @replies %>
|
<%= 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 %>
|
<% 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 %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<%= form_for [reply.thread, reply] do |f| %>
|
<%= form_for [reply.thread, reply] do |f| %>
|
||||||
<%= render partial: "md_editor", locals: {name: "threadreply[content]", content: reply.content, mini: false} %>
|
<%= render partial: "md_editor", locals: {name: "threadreply[content]", content: reply.content, mini: false} %>
|
||||||
<p><%= f.submit "Reply", class: "btn blue" %></p>
|
<p><%= f.submit "Reply#{ ' (Locked)' if reply.thread.locked? }", class: "btn blue" %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
Reference in New Issue
Block a user