{% extends 'modal_base.html' %}
{% load i18n %}

{% block title %}
	{% if object.pk %}
        {% trans 'Edit details' %}
    {% else %}
        {% trans 'New document' %}
    {% endif %}
{% endblock %}

{% block body %}
    <form action="{% if document.pk %}{{ document.get_edit_url }}{% else %}{% url 'trainings:document-create' training_uuid=training.id %}{% endif %}"
          method="post" enctype="multipart/form-data" id="document-form">{% csrf_token %}
        <div class="modal-body">
            {% include 'extras/form.html' with display="block" %}
        </div>
        <div class="modal-footer clearfix">
            <button type="button" class="btn my-btn btn-default pull-left" data-dismiss="modal">{% trans 'Cancel' %}</button>
            <input class="btn my-btn my-btn-purple pull-right" type="submit" value="{% trans 'Confirm' %}" />
        </div>
    </form>
    <script type="text/javascript">
        $('#document-form').autoAjaxForm();
    </script>
{% endblock %}
