{% extends "@FerienpassAdmin/layout/list.html.twig" %}


{% block list %}
{{ component('Admin:SearchableQueryableList', {
        qb: qb,
        filterType: filterType,
        routeName: app.current_route,
        routeParameters: app.current_route_parameters|merge(app.request.query.all),
        searchable: searchable|default([]),
        headline: (headline == "#{translationPrefix}.#{action}.title") ? "#{translationPrefix}.title"|trans : headline,
        createUrl: createUrl|default(null),
        viewKey: 'admin_hosts',
        viewPathPrefix: '/admin/veranstaltende',
        exports: exports|default([]),
        config: {
            title: '{{ item.name|default("") }}',
            info: [
                '{{ item.offers|length }} Angebote',
            ],
            columns: {
                name: '<a href="{{ path("admin_hosts_show", { uuid: item.uuid.toBase58 }) }}" class="hover:bg-gray-200/75 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-gray-100 rounded-md px-1.5 py-1 -mx-1.5 -my-1 transition-colors font-medium text-gray-900 dark:text-gray-100" data-turbo-frame="slideover">{{ item.name|default("") }}</a>',
                accounts: '{{ item.users|map(u => "#{u.firstname} #{u.lastname}")|join(", ") }}',
                phone: '{{ [item.phone, item.mobile]|filter(v => v)|join(" / ") }}',
                email: '{{ item.email }}',
                numberOffers: '{{ item.offers|length }}',
            }
        }}) }}
{% endblock %}
