{% load i18n %}

<!-- Modal -->
{% if not show_inline %}
<div class="modal fade" id="{{ id }}" tabindex="1" role="dialog" aria-labelledby="{{ id }}Label" aria-hidden="true">
{% endif %}
    <div class="modal-dialog {{ extra_modal_classes }}">
        <div class="modal-content">
            <div class="modal-header">
                
                {% if not show_inline %}
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    <i class="fa fa-times"></i>
                </button>
                {% endif %}
                <h4 class="modal-title no-select" id="{{ id }}Label">
                    <i class="fa {% if title_icon %}{{ title_icon }}{% else %}fa-eraser{% endif %}"></i>
                    {{ title }}
                </h4>
            </div>
            
            {% if form_action %}
            <form action="{{ form_action }}" method="post" class="form-horizontal">{% csrf_token %}
            {% endif %}
            
            <div class="modal-body">
                {{ label|safe }}
            </div>
            <div class="modal-footer">
                <button type="submit" id="{{ id }}_btnsubmit" class="submit-btn-x btn btn-emphasized" {% if not form_action %}data-dismiss="modal"{% endif %} {% if disable_on_submit %}onclick="setTimeout(function(){$('#{{ id }}_btnsubmit').attr('disabled', true);},50);"{% endif %}>
                    <ul class="media-list">
                        <li class="media">
                            <a class="pull-left" href="#">
                                <i class="fa fa-check"></i>
                            </a>
                            <div class="media-body">
                                {% if submit_button_label %}{{ submit_button_label }}{% else %}{% trans "OK" %}{% endif %}
                            </div>
                        </li>
                    </ul>
                </button>
                {% if form_action and not hide_cancel_button %}
	                <button type="button" class="btn btn-emphasized" data-dismiss="modal">
	                    <ul class="media-list">
	                        <li class="media">
	                            <a class="pull-left" href="#">
	                                <i class="fa fa-times"></i>
	                            </a>
	                            <div class="media-body">
	                                {% if cancel_button_label %}{{ cancel_button_label }}{% else %}{% trans "Cancel" %}{% endif %}
	                            </div>
	                        </li>
	                    </ul>
	                </button>
	                {% if form_extra_fields %}
	                    {{ form_extra_fields }}
	                {% endif %}
                {% endif %}
            </div>
            {% if form_action %}
            </form>
            {% endif %}
        </div>
    </div>
   
{% if not show_inline %}
</div><!-- modal -->
{% endif %}