{% extends "spirit/_base.html" %}

{% load spirit_tags i18n %}

{% block title %}{% trans "Publish topic" %}{% endblock %}

{% block head-extra %}
  <script>
    document.addEventListener('DOMContentLoaded', function() {
      stModules.store(
        document.querySelector('textarea'),
        'topic_publish_comment'
      );
    });
  </script>
{% endblock %}

{% block content %}
  <div class="layout__article">
    <h1 class="headline">{% trans "Publish topic" %}</h1>

    <form action="." method="post" class="js-reply">
      {% csrf_token %}

      {# topic #}
      {% include "spirit/_form.html" %}

      {# comment #}
      <div class="topic_publish_comment">
        {% include "spirit/_form.html" with form=cform %}
        {% include "spirit/comment/_editor_preview.html" %}
      </div>
      <div class="comment__reply__actions">
        {% include "spirit/comment/_editor.html" %}
        <input
          class="button comment__reply__actions__publish"
          type="submit"
          value="{% trans "Publish" %}" />
      </div>
    </form>
  </div>
{% endblock %}
