{% load custom_tags_and_filters %}
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Modal close button">&times;</button>
    <h4 id="modal-description-label" class="modal-title">Choose tool configuration</h4>
</div>
<div class="modal-body">
    {# Assume the dialog is cancelled by default, preventing the reservation request from being processed further. #}
    {# When a button is clicked this value is set to false, enabling further processing. #}
    {# Hiding the dialog using the X in the top right, or clicking outside of it, will stop processing. #}
    <input type="hidden" id="dialog_cancelled" value="true">
    <form id="additional_event_parameters">
        <input type="hidden" id="configured" name="configured" value="true">
        {% if not sufficient_notice %}
            <div class="alert alert-danger">
                <strong>Warning:</strong> {{ notice_limit }} hours of advance notice is required when reserving this tool in order to configure it properly. You may still create a reservation right now, but there is no guarantee the tool will be properly configured when you arrive to use it.
            </div>
            <p>
            {% endif %}
            {% include 'configuration/configuration_reservation_helper.html' %}
        </form>
    </div>
    <div class="modal-footer">
        {% button type="save" submit=False dismiss="modal" onclick="$('#dialog_cancelled').val(false);" value="Create this reservation" %}
    </div>
    <script>$('[data-toggle~="tooltip"]').tooltip();</script>
