{% extends "aa_forum/base.html" %}

{% load django_bootstrap5 %}
{% load i18n %}

{% block page_title %}
    {% translate "Start new topic" as page_title %}
    {% translate "Forum" as app_title %}

    {{ page_title|title }} » {{ app_title }}
{% endblock %}

{% block aa_forum_header %}
    {% include "aa_forum/partials/breadcrumb.html" with category=board.category board=board new_topic="yes" %}
{% endblock %}

{% block aa_forum_body %}
    <div class="card card-default">
        <div class="card-header">
            <div class="card-title mb-0">
                {% translate "Start new topic in" %}
                "<a href="{{ board.get_absolute_url }}">{{ board.name }}</a>"
            </div>
        </div>

        <div class="card-body">
            <form id="aa-forum-form-new-topic" autocomplete="off" action="{% url 'aa_forum:forum_board_new_topic' board.category.slug board.slug %}" method="post">
                {% csrf_token %}

                {% bootstrap_form form %}

                {% include "aa_forum/partials/form/required-field-hint.html" %}

                <div class="form-group aa-forum-form-group aa-forum-form-new-topic float-end clearfix">
                    <a id="aa-forum-btn-cancel" class="btn btn-secondary btn-sm" href="{{ board.get_absolute_url }}">{% translate "Cancel" %}</a>
                    <button class="btn btn-secondary btn-sm" type="reset">{% translate "Clear form" %}</button>
                    <button class="btn btn-primary btn-sm" type="submit">{% translate "Start topic" %}</button>
                </div>
            </form>
        </div>
    </div>
{% endblock %}

{% block extra_css %}
    {% include "aa_forum/bundles/ckeditor5-css.html" %}
    {% include "aa_forum/bundles/aa-forum-css.html" %}
{% endblock %}

{% block extra_javascript %}
    {% include "aa_forum/bundles/ckeditor5-js.html" %}
    {% include "aa_forum/bundles/aa-forum-ckeditor-js.html" %}
{% endblock %}
