{% load i18n %}

<form action="{% url "spirit:comment:publish" topic_id %}" method="post" class="js-reply">
  {% csrf_token %}
  {% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}

  {{ form.non_field_errors }}

  {% for field in form %}
    {{ field.errors }}
    {{ field }}
  {% endfor %}

  <div class="container">
    {% include "spirit/comment/_editor.html" %}

    <input class="button reply-button" type="submit" value="{% trans "Publish" %}" />
  </div>
</form>


<script>
  document.addEventListener('DOMContentLoaded', function() {

    stModules.store(
      document.querySelector('.reply').querySelector('textarea'),
      'comment-thread-{{ topic_id }}'
    );

  });
</script>
