<%= javascript_include_tag "validateFileInputs", defer: true %>
<% if @comment.errors.any? %>
<%= t("views.comments.write.errors", count: @comment.errors.count) %>
<% @comment.errors.full_messages.each do |message| %>
- <%= message %>
<% end %>
<% 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 %>
<% end %>
<% if @comment.persisted? %>
<% end %>
<%= t("views.comments.write.template.create.desc") %>