{% if items is defined and items|length > 0 %} {% for item in items %} {# Рендерим каждую колонку #} {% for key, column in columns %} {{ render_cell(item, key, column)|raw }} {% endfor %} {# Колонка действий #} {% if actionsConfig is defined and actionsConfig|length > 0 %} {# Фильтруем действия на основе прав доступа #} {% set visibleActions = [] %} {% for action in actionsConfig %} {% set showAction = true %} {% if action.type is defined %} {% if action.type == 'edit' and not (can_edit|default(true)) %} {% set showAction = false %} {% elseif action.type == 'delete' and not (can_delete|default(true)) %} {% set showAction = false %} {% endif %} {% endif %} {% if showAction %} {% set visibleActions = visibleActions|merge([action]) %} {% endif %} {% endfor %} {% if visibleActions|length > 0 %} {{ render_actions(item, visibleActions)|raw }} {% else %} {% endif %} {% endif %} {% endfor %} {% else %} {# Пустое состояние #} {% if emptyIcon is defined and emptyIcon %}
{% endif %}

{{ emptyMessage|default('Нет данных') }}

{% if emptyActionUrl is defined and emptyActionUrl %} {% if emptyActionIcon is defined and emptyActionIcon %} {% endif %} {{ emptyActionLabel|default('Добавить') }} {% endif %} {% endif %} {# Футер с пагинацией #} {{ include('@components/table/pagination.twig', { pagination: pagerDetails, id: id }) }}