{% extends 'core_main_app/_render/admin/theme/tools/modal.html' %}

{% block modal_id %}create-workspace-modal{% endblock %}
{% block modal_title %}Create new workspace{% endblock %}


{% block modal_body %}
    <div class="alert alert-danger" id="banner_errors" style="display: none;">
        <h4>
            <i class="fas fa-exclamation-circle"></i>
            An error occured while creating the workspace!
        </h4>
        <div id="create_workspace_errors"></div>
    </div>
    <div>
        <input type="hidden" class="{{ data.document }}-id"/>
        <p class="m-0">Please enter the name of the new workspace.</p>
    </div>
    <div class="mt-2">
        {% for field in data.workspace_form %}
            <div class="d-flex flex-row mx-4">
                <div class="d-flex align-items-center justify-content-center"
                     style="width:30%">
                    {{ field.label_tag }}
                </div>
                <div class="{% if BOOTSTRAP_VERSION|first == "4" %}ml-2{% elif BOOTSTRAP_VERSION|first == "5"  %}ms-2{% endif %} d-flex align-items-center" style="width:90%">{{ field }}</div>
            </div>
        {% endfor %}
    </div>
{% endblock %}

{% block modal_footer %}
    <button class="btn btn-secondary pull-left" {% if BOOTSTRAP_VERSION|first == "4" %}data-dismiss{% elif BOOTSTRAP_VERSION|first == "5"  %}data-bs-dismiss{% endif %}="modal">
        <i class="fas fa-times-circle"></i> Cancel
    </button>
    <button id="create-workspace-confirm" class="btn btn-primary">
        <i class="fas fa-plus-circle"></i> Create Workspace
    </button>
{% endblock %}