{% extends 'base.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}
{% block main %}
{% set hasTwoColumns = (config.dragDropAmount > 0 and dragAndDrop is not empty and (dragAndDrop|filter(s => s.entries|length > 0)|length > 0)) or form is not null %}
{% if hasTwoColumns %}
{% if form is not null %}
{% embed '@theme/embeds/card.html.twig' %}
{% block box_body %}
{{ form_start(form) }}
{% if form.user is defined %}
{{ form_row(form.user) }}
{% endif %}
{{ form_rest(form) }}
{{ form_end(form) }}
{% endblock %}
{% endembed %}
{% endif %}
{% for source in dragAndDrop|filter(s => s.entries|length > 0) %}
{% embed '@theme/embeds/card.html.twig' %}
{% block box_title %}{{ source.title|trans({}, source.translationDomain) }}{% endblock %}
{% block box_body_class %}drag-and-drop-source p-0{% endblock %}
{% block box_body %}
{% for entry in source.entries|slice(0, config.dragDropAmount) %}
{% if source.blockInclude is not null and entry.blockName is not null and block(entry.blockName, source.blockInclude) is defined %}
{{ block(entry.blockName, source.blockInclude) }}
{% else %}
{{ entry.title }}
{% endif %}