{% extends 'board_base.html' %}
{% load i18n %}
{% load forum_conversation_tags %}

{% block sub_title %}{% trans "Edit post" %}{% endblock sub_title %}

{% block content %}
<div class="row">
  <div class="col-12">
    <h1>{{ topic.subject }}</h1>
  </div>
</div>
{% if preview %}
  {% include "forum_conversation/post_preview.html" %}
{% endif %}
<div>
  <div class="w-full rounded border bg-charcoal/60 border-1 border-slate">
    <div class="card post-edit">
      <div class="py-2 px-4 border-b card-header border-slate">
        <h3 class="m-0 text-base h5 card-title">{% trans "Edit post" %}</h3>
      </div>
      <div class="p-4 card-body">
        <form method="post" action="." class="form" enctype="multipart/form-data" novalidate>{% csrf_token %}
          {% include "forum_conversation/partials/post_form.html" %}
          <div class="form-actions">
            <input type="submit" name="preview" class="py-3 px-8 text-sm text-base font-medium uppercase rounded-md border md:py-1 md:px-4 md:text-lg border-slate text-orange" value="{% trans "Preview" %}" />&nbsp;
            <input type="submit" class="py-3 px-8 text-sm text-base font-medium uppercase rounded-md border md:py-1 md:px-4 md:text-lg border-orange text-orange" value="{% trans "Submit" %}" />
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
{% endblock content %}

{% block onbodyload %}
  machina.attachment.init();
{% endblock onbodyload %}

{% block extra_css %}
  {{ post_form.media.css }}
{% endblock extra_css %}

{% block extra_js %}
  {{ post_form.media.js }}
{% endblock extra_js %}
