{% extends base_template %}
{% load i18n static bootstrap3 popupcrud_list bsmodal %}
{% block extrahead %}
{{ view.media }}
{% endblock extrahead %}
{% block content %}
{% block popupcrud_list %}
{% block create_new %}
{% if new_url %}
<div>
{% if object_list %}
{% if not viewset.popups.create %}
    <a class="btn btn-primary" href="{{ new_url }}" type="link">{{ new_button_text }}</a>
{% else %}
    <a class="btn btn-primary" href="javascript:void(0);" name="create_edit_object" type="link" data-url="{{ new_url }}" data-title="{{ new_button_text }}">{{ new_button_text }}</a>
{% endif %}
{% endif %}
</div>
{% endif %}
{% endblock create_new %}
{% if object_list %}
{% list_content %}
{% include "popupcrud/_pagination.html" %}
{% else %}
{% empty_list %}
{% endif %}
{% if viewset.popups.create or viewset.popups.update %}
{% bsmodal '??' 'create-edit-modal' close_title_button=Yes header_bg_css=bg-primary size=modal_sizes.create_update %}
    {# modal body will be filled in by jQuery.load(<new_object_url>) return value #}
    ??
{% endbsmodal %}
{% bsmodal '??' 'add-related-modal' close_title_button=Yes %}
    {# modal body will be filled in by jQuery.load(<new_object_url>) return value #}
    ??
{% endbsmodal %}
{% endif %} {# {% if viewset.popups.create or viewset.popups.update %} #}
{% if viewset.popups.detail %}
{% bsmodal '??' 'detail-modal' close_title_button=Yes header_bg_css=bg-primary %}
    {# modal body will be filled in by jQuery.load(<object_detail_url>) return value #}
    ??
{% endbsmodal %}
{% endif %} {#{% if viewset.popups.detail %} #}
{% trans 'Confirm Delete' as confirm_delete_title %}
{% if viewset.popups.delete %}
{% bsmodal confirm_delete_title 'delete-modal' close_title_button=Yes header_bg_css=bg-primary size=modal_sizes.delete %}
    <strong>{{ model_options.verbose_name }}:</strong><br/> <span id='id_object_name'></span><br/>
    <br/>
    <p>{% trans 'Are you sure you want to delete this?' %}</p>
    <form role="form" id="delete-form" action="" method="post">
        {% csrf_token %}
        <div class="form-group">
            <button type="submit" class="btn btn-danger">{% trans 'Yes' %}</button>
            <button type="button" class="btn btn-primary" data-dismiss="modal">{% trans 'No' %}</button>
        </div>
    </form >
{% endbsmodal %}
{% trans 'Action Result' as result %}
{% bsmodal result 'action-result-modal' close_title_button=Yes header_bg_css=bg-primary %}
    <div id='id_action_result'></div><br/>
    <div class="text-center form-group">
        <button type="button" class="btn btn-default" data-dismiss="modal">{% trans 'Close' %}</button>
    </div>
{% endbsmodal %}
{% endif %} {# if viewset.popups.delete %} #}
{% endblock popupcrud_list %}
{% endblock content %}
