<%= javascript_include_tag "validateFileInputs", defer: true %> <% if @comment.errors.any? %> <% end %> <%= form_for(@comment, authenticity_token: false, html: { class: "comment-form print-hidden" }) do |f| %> <% if @article&.comment_template.present? && @comment.new_record? %>
<%= t("views.comments.write.template.article") %>
<% end %> <%# this is used by JS and it will be replaced with the CSRF token received from the server %> <% unless @comment.persisted? %> <%= f.hidden_field :commentable_id, value: commentable&.id %> <%= f.hidden_field :commentable_type, value: commentable_type %> <%= f.hidden_field :parent_id, value: @parent_comment.id if @parent_comment %> <% end %> pic
<%= f.text_area :body_markdown, placeholder: t("views.comments.write.field.placeholder"), onfocus: "handleFocus(event)", onkeyup: "handleKeyUp(event)", onkeydown: "handleKeyDown(event)", oninput: "handleChange(event)", id: "text-area", required: true, class: "crayons-textfield comment-textarea crayons-textfield--ghost", "aria-label": t("views.comments.write.field.aria_label") %>
<% end %> <% if @comment.persisted? %> <% end %>