{% extends "sveedocuments/board/subbase_inserts.html" %}
{% load i18n djangocodemirror_inputs djangocodemirror_assets crispy_forms_tags autobreadcrumb %}

{% block head_base_js %}{{ block.super }}
    {% get_current_language as LANGUAGE_CODE %}
    {% include "sveedocuments/board/includes/djangocodemirror_content_assets.html" %}
    <script type="text/javascript">
    //<![CDATA[
    DCM_lang = "{{ LANGUAGE_CODE }}";
    $(document).ready(function() {
        $("#id_slug").slugify("#id_title");
        
        {% if insert_instance %}DJANGOCODEMIRROR_OBJECT = {
            'id': {{ insert_instance.id }},
            'slug': '{{ insert_instance.slug }}'
        };{% endif %}
        
        var content_codemirror_instance = $('#{{ form.content.auto_id }}').djangocodemirror({{ form.content|djangocodemirror_init_input }});
    });
    //]]>
    </script>
{% endblock %}

{% block board_content %}
    <h2>{% current_title_from_breadcrumbs %}</h2>

    {% if insert_instance and insert_instance.visible %}{% include "sveedocuments/board/includes/insert_form_subnav.html" with active_tab="edit" %}{% endif %}

    {% crispy form %}
{% endblock %}
