Files
danbooru/app/views/comments/_form.html.erb
evazion 804a2ef9a5 Fix #4535: Comment edit forms contain duplicate IDs.
Prefix comment form IDs with `post_<id>_comment_<id>` to ensure
uniqueness.
2020-06-26 14:57:19 -05:00

17 lines
682 B
Plaintext

<%= error_messages_for :comment %>
<%= edit_form_for(comment, namespace: "post_#{comment.post.id}_comment_#{comment.id || "new"}", html: { style: ("display: none;" if local_assigns[:hidden]), class: "edit_comment" }) do |f| %>
<% if comment.new_record? %>
<%= f.hidden_field :post_id %>
<% end %>
<%= f.input :body, as: :dtext %>
<%= f.button :submit, "Submit" %>
<%= dtext_preview_button "comment_body" %>
<% if comment.new_record? %>
<%= f.input :do_not_bump_post, :label => "No bump" %>
<% end %>
<% if policy(comment).can_sticky_comment? %>
<%= f.input :is_sticky, :label => "Post as moderator", :for => "comment_is_sticky" %>
<% end %>
<% end %>