{% if edit_mode %}
    {% set title = _("Edit Post") %}
{% else %}
    {% set title = _("New Post") %}
{% endif %}

{% set page_title = title %}
{% set active_forum_nav=True %}

{% extends theme("layout.html") %}

{% block content %}
{% from theme("macros.html") import render_field, render_submit_field, render_quickreply, render_boolean_field %}

<div class="page-view">
    <ol class="breadcrumb flaskbb-breadcrumb">
        <li><a href="{{ url_for('forum.index') }}">{% trans %}Forum{% endtrans %}</a></li>
        <li><a href="{{ topic.forum.url }}">{{ topic.forum.title }}</a></li>
        <li><a href="{{ topic.url }}">{{ topic.title }}</a></li>
        <li class="active">
            {{ title }}
        </li>
    </ol>

    <form class="form-horizontal" role="form" method="post">
        {{ form.hidden_tag() }}
        <div class="panel page-panel">
            <div class="panel-heading page-head">
                {{ title }}
            </div>

            <div class="panel-body page-body">
                <div class="col-md-12 col-sm-12 col-xs-12">

                    <div class="form-group">
                        <div class="col-md-12 col-sm-12 col-xs-12">

                            <div class="editor-box">

                                {{ run_hook("flaskbb_tpl_form_new_post_before", form=form) }}

                                <div class="editor">
                                    {{ render_quickreply(form.content, div_class="new-message", rows=7, cols=75, placeholder="", **{'data-provide': 'markdown', 'data-autofocus': 'false', 'class': 'flaskbb-editor'}) }}
                                </div>

                                {{ render_boolean_field(form.track_topic) }}

                                {{ run_hook("flaskbb_tpl_form_new_post_after", form=form) }}

                                <div class="editor-submit">
                                    {{ render_submit_field(form.submit, input_class="btn btn-success pull-right") }}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {% include theme('editor_help.html') %}
    </form>
</div>

{% endblock %}
