{% set headers = _args.headers|default([
{
title: 'Name',
spacing: 35,
sort: 'name',
},
{
title: 'Email',
sort: 'email',
},
{
title: 'Status',
sort: 'active',
},
{
title: 'Synced',
spacing: 5,
sort: 'oneroster',
},
{
title: 'Last Login',
sort: 'last_login',
},
{
title: 'Last Modified',
sort: 'timestamp',
},
]) %}
{% embed '@ui2022/table--search.html.twig' with {
form: form,
headers: headers,
pagination: pagination,
} %}
{% block items %}
{% if accounts is empty %}
{% include '@ui2022/table__empty.html.twig' with {
title: 'No accounts found',
message: 'No accounts matching the criteria were found in the system.'
} %}
{% else %}
{% for account in accounts %}
<tr>
{% include '@ui2022/table__item__cell--status.html.twig' with {
title: account.displayName,
link: path('app.app.dashboard.settings.accounts.roles.main', {
account: account.id,
}),
sidepanel: sidepanel,
actions: [
{
text: 'Edit',
link: path('app.app.dashboard.settings.accounts.update', {
account: account.id,
}),
sidepanel: sidepanel,
},
{
text: 'More',
dropdown: {
items: [
account.active ? ({
text: 'Deactivate',
link: path('app.app.dashboard.settings.accounts.deactivate', {
account: account.id,
}),
modal: 'modal__result',
}) : ({
text: 'Reactivate',
link: path('app.app.dashboard.settings.accounts.reactivate', {
account: account.id,
}),
modal: 'modal__result',
}),
account.canManagePassword ? ({
text: 'Manage Password',
link: path('app.app.dashboard.settings.accounts.manage_password', {
account: account.id,
}),
modal: 'modal__result',
}) : null,
]
},
}
],
} %}
{% include '@ui2022/table__item__cell--default.html.twig' with {
text: account.email,
link: path('app.app.dashboard.settings.accounts.roles.main', {
account: account.id,
}),
sidepanel: sidepanel,
} %}
<td>{{ account.active ? 'Active' : 'Inactive' }}</td>
<td>{{ account.oneRoster ? '<i class="icon-check"></i>' : '' }}</td>
<td>
{{- account.lastLoggedInAt ? account.lastLoggedInAt|ui_relativeDate : '' -}}
</td>
<td>
{{- account.touchedAt|ui_relativeDate -}}
</td>
</tr>
{% endfor %}
{% endif %}
{% endblock %}
{% endembed %}