{% extends "atlas/base.html" %}
{% load crispy_forms_tags %}

{% block js %}
    {{ form.media }}
{% endblock %}

{% block content %}
    <h2>Add / Edit Procedure</h2>
    <p>Use this form to create or edit a procedure.</p>
    <p>Please check if it already <a href='{% url "atlas:procedure_view" %}'>exists</a> before doing so!</p>

    <form action="{% url 'atlas:procedure_create' %}" method="post" enctype="multipart/form-data" id="procedure-form" onsubmit="console.log('procedure-form submit', this);">
        {% csrf_token %}
        {% crispy form %}

        <div class="mt-3">
            <button type="submit" id="procedure-submit" class="btn btn-primary">Submit</button>
            <a class="btn btn-secondary ms-2" href="{% url 'atlas:procedure_view' %}">Cancel</a>
        </div>
    </form>

{% endblock %}
