comments: add standalone new comment form.
Add standalone /comments/new page to allow commenting if javascript is disabled.
This commit is contained in:
@@ -106,6 +106,6 @@ private
|
||||
permitted_params += %i[is_deleted] if context == :update
|
||||
permitted_params += %i[is_sticky] if CurrentUser.is_moderator?
|
||||
|
||||
params.require(:comment).permit(permitted_params)
|
||||
params.fetch(:comment, {}).permit(permitted_params)
|
||||
end
|
||||
end
|
||||
|
||||
13
app/views/comments/new.html.erb
Normal file
13
app/views/comments/new.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<div id="c-comments">
|
||||
<div id="a-new">
|
||||
<h1>New Comment</h1>
|
||||
|
||||
<%= render "comments/form", comment: @comment %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
New Comment - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<% if CurrentUser.is_member? %>
|
||||
<div class="new-comment">
|
||||
<p><%= link_to "Post comment", new_comment_path, :class => "expand-comment-response" %></p>
|
||||
<p><%= link_to "Post comment", new_comment_path(comment: { post_id: post.id }), :class => "expand-comment-response" %></p>
|
||||
<%= render "comments/form", comment: post.comments.new, hidden: true %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user