{% extends 'Comitium5DesignerBundle:Breakpoint:base.html.twig' %}
{% import 'Comitium5DesignerBundle:Common:alerts.html.twig' as alerts %}

{% block page_content %}
    <div class="container-fluid">

        <!-- Page Heading -->

        <a href="{{ url("designer_breakpoint_create") }}" class="btn btn-primary btn-icon-split btn-md">
            <span class="text">{{ "breakpoint_admin.new_button"|trans }}</span>
        </a>

        <div class="my-4"></div>
        {% if pagination|length %}
            <div class="table-responsive">
                <table class="table table-bordered table-striped" width="100%" cellspacing="0"
                       data-total-items="{{ pagination.totalItemCount }}">
                    <thead>
                    <tr>
                        <th>{{ "breakpoint_admin.fields.name"|trans }}</th>
                        <th>{{ "breakpoint_admin.fields.type"|trans }}</th>
                        <th>{{ "breakpoint_admin.fields.min_width"|trans }}</tr>
                    </tr>
                    </thead>
                    <tbody>
                    {% for breakpoint in pagination %}
                        <tr data-id-content="{{ breakpoint.id }}">
                            <td>
                                <a href="{{ url('designer_breakpoint_edit', {id: breakpoint.id}) }}">{{ breakpoint.name }}</a>
                            </td>
                            <td>{{ ("breakpoint_admin.types." ~ breakpoint.type)|trans }}</td>
                            <td>{{ breakpoint.minWidth }}</td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
        {% else %}
            {% if 'admin_breakpoint_search' == route %}
                {{ alerts.warning({text : 'cs_core.no_search_results', translation_attributes : {'%something%': 'designer_common.entity.breakpoint'|transchoice(1) } }) }}
            {% elseif 'admin_breakpoint_page' == route %}
                {{ alerts.info({text : 'cs_core.no_entries.m', translation_attributes : {'%something%': 'designer_common.entity.breakpoint'|transchoice(2) } }) }}
            {% endif %}
        {% endif %}
        {{ knp_pagination_render(pagination) }}
    </div>
{% endblock %}