{% set minimal = _args.minimal|default(false) %}
{% set pagination_target = _args.pagination_target|default(null) %}
{% if minimal %}
{% set headers = _args.headers|default([
{
title: 'Name',
sort: constant('SORTS__LAST_NAME', search),
},
]) %}
{% else %}
{% set headers = _args.headers|default([
{
title: 'Last Name',
spacing: 25,
sort: constant('SORTS__LAST_NAME', search),
},
{
title: 'First Name',
sort: constant('SORTS__FIRST_NAME', search),
},
]) %}
{% endif %}
{% if additionalTitles is defined %}
{% for additionalTitle in additionalTitles %}
{% set headers = headers|merge([
{
headerTitle: additionalTitle.categoryName,
title: additionalTitle.name,
},
]) %}
{% endfor %}
{% endif %}
{% set headers = headers|merge([
{
title: 'Type',
spacing: 10,
sort: constant('SORTS__TYPE', search),
},
]) %}
{% if not minimal %}
{% set headers = headers|merge([
{
title: 'Status',
spacing: 10,
sort: constant('SORTS__STATUS', search),
},
{
title: 'Last Modified',
spacing: 10,
sort: constant('SORTS__TIMESTAMP', search),
},
]) %}
{% endif %}
{% embed '@ui2022/table--search.html.twig' with {
form: form,
headers: headers,
pagination: pagination|merge({target: pagination_target})|default(null),
} %}
{% block items %}
{% if profiles is empty %}
{% include '@ui2022/table__empty.html.twig' with {
title: 'No contacts found',
message: 'No contacts matching the criteria were found in the system.'
} %}
{% else %}
{% for profile in profiles %}
<tr data-cs-id="{{ profile.id }}">
{% if minimal %}
{% include '@ui2022/table__item__cell--default.html.twig' with {
text: profile.sortName ?: '—',
link: path('app.notifications.dashboard.profiles.view', {
profile: profile.id,
}),
sidepanel: sidepanel,
actions:
(discr is defined and discr is same as('static'))
?
[
{
text: 'Remove',
link: '#',
attr: {
"data-cs-id": profile.id,
"class": 'btw__profile_remove'
},
},
]
:
[],
} %}
{% else %}
{% include '@ui2022/table__item__cell--default.html.twig' with {
text: profile.lastName ?: '—',
link: path('app.notifications.dashboard.profiles.view', {
profile: profile.id,
}),
sidepanel: sidepanel,
actions: [],
} %}
{% include '@ui2022/table__item__cell--default.html.twig' with {
text: profile.firstName ?: '—',
link: path('app.notifications.dashboard.profiles.view', {
profile: profile.id,
}),
sidepanel: sidepanel,
actions: [],
} %}
{% endif %}
{% if additionalValues[profile.id] is defined %}
{% for additionalValue in additionalValues[profile.id] %}
<td>
{% if additionalValue is iterable %}
<ul class="list-unstyled">
{% for additionalValueItem in additionalValue %}
<li>{{ additionalValueItem }}</li>
{% endfor %}
</ul>
{% else %}
{{ additionalValue }}
{% endif %}
</td>
{% endfor %}
{% endif %}
<td>
{{- 'app.notifications.profiles.types.%s'|format(profile.roleTypeName)|trans() -}}
</td>
{% if not minimal %}
<td>
{{- 'app.notifications.reachability.%s'|format(profile.reachabilityIndex)|trans -}}
</td>
<td>
{{- profile.timestampedAt|ui_relativeDate -}}
</td>
{% endif %}
</tr>
{% endfor %}
{% endif %}
{% endblock %}
{% endembed %}