{% extends "agenda_culturel/page-admin.html" %}
{% load static %}

{% block entete_header %}
<script src="{% url 'jsi18n' %}"></script>
<script src="/static/admin/js/vendor/jquery/jquery.js"></script>
<script src="/static/admin/js/jquery.init.js"></script>
<script src="{% static 'choicejs/choices.min.js' %}"></script>
<script>window.CKEDITOR_BASEPATH = '/static/ckeditor/ckeditor/';</script>
{% endblock %}

{% block title %}{% block og_title %}{% if object %}Description de {{ object.name }}{% else %}Description d'un organisme{% endif %}{% endblock %}{% endblock %}

{% block fluid %}{% endblock %}

{% block content %}

<article>
    <header>
        <h1>{% if object %}Description de {{ object.name }}{% else %}Description d'un organisme{% endif %}</h1>
    </header>

    <form method="post">{% csrf_token %}
        {{ form.media }}
        {{ form.as_p }}

        <div class="grid buttons">
            <a href="{% if request.META.HTTP_REFERER %}{{ request.META.HTTP_REFERER }}{% else %}{% if object %}{{ object.get_absolute_url }}{% else %}{% url 'view_organisations' %}{% endif %}{% endif %}" role="button" class="secondary">Annuler</a>
            <input type="submit" value="Envoyer">
        </div>
    </form>
</article>

<script>
const places = document.querySelector('#id_principal_place');
const choices_places = new Choices(places,
    {
            shouldSort: false,
    }
);
</script>

{% endblock %}