{% extends extend_template %}
{% block content %}
{% for message in messages %}
    <div class="alert {% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}alert-danger{% elif message.level == DEFAULT_MESSAGE_LEVELS.WARNING %}alert-warning{% elif message.level == DEFAULT_MESSAGE_LEVELS.SUCCESS %}alert-success{% elif message.level == DEFAULT_MESSAGE_LEVELS.INFO %}alert-info{% else %}alert-primary{% endif %}"role="alert">{{ message }}</div>
{% endfor %}
<div class="container">
    {% if context.title and context.show_title or context.title_as_caption%}<h1>{% if context.title_as_caption %}{{context.caption}}{% else %}{{context.title}}{% endif %}</h1>{% endif %}
    {% include 'blitz_crud_search.html' with search_text=crud_button.search %}
    <div class="btn-toolbar mb-3" role="toolbar">
        <div class="btn-group mr-1">
            <a role="button" href="{% url crud_url.create %}" class="btn btn-outline-success"><i class="fas fa-plus"></i> {{crud_button.add}}</a>
        </div>
        <div class="blitzSelectionButtons">
            <div class="btn-group">
                <button type="button" role="button" onclick="getSelected('{% url crud_url.update %}');" class="btn btn-outline-warning"><i class="fas fa-edit"></i> {{crud_button.edit}}</button>
            </div>
            <div class="btn-group">
                <button type="button" role="button" onclick="getSelected('{% url crud_url.detail %}');" class="btn btn-outline-info"><i class="fas fa-eye"></i> {{crud_button.details}}</a>
            </div>
            <div class="btn-group">
                <button  type="button" role="button" onclick="getSelected('{% url crud_url.delete %}');" class="btn btn-outline-danger"><i class="fas fa-trash"></i> {{crud_button.delete}}</button>
            </div>
            <div class="btn-group">
                <button role="button" class="btn btn-outline-secondary" onclick="cancelSelection();" ><i class="fas fa-times"></i> {{crud_button.cancel}}</button>
            </div>
        </div>
    </div>
    {% include table_template %}
</div>
{% endblock %}