{% extends 'base.html.twig' %} {% import "macros/datatables.html.twig" as tables %} {% import "macros/widgets.html.twig" as widgets %} {% import "macros/toolbar.html.twig" as toolbar %} {% import "user/actions.html.twig" as actions %} {% set columns = { 'alias': {'class': 'alwaysVisible'}, 'title': {'class': 'hidden-xs hidden-sm'}, 'email': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false}, 'lastLogin': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false}, 'roles': {'class': 'hidden-sm', 'orderBy': false}, } %} {% for pref in preferences %} {% set columns = columns|merge({ ('mf_' ~ pref.name): {'title': pref.label|trans, 'class': 'hidden-xs hidden-sm', 'orderBy': false} }) %} {% endfor %} {% set columns = columns|merge({ 'team': {'class': 'text-center hidden-xs w-min', 'orderBy': false}, 'active': {'class': 'hidden-xs hidden w-min', 'orderBy': false}, 'actions': {'class': 'actions alwaysVisible'}, }) %} {% set tableName = 'user_admin' %} {% block page_title %}{{ 'admin_user.title'|trans }}{% endblock %} {% block page_search %}{{ toolbar.dropDownSearch(toolbarForm) }}{% endblock %} {% block page_actions %}{{ actions.users('index') }}{% endblock %} {% block main_before %} {{ tables.data_table_column_modal(tableName, columns) }} {% endblock %} {% block main %} {% if entries.count == 0 %} {{ widgets.nothing_found('kimai.userUpdate') }} {% else %} {{ tables.datatable_header(tableName, columns, query, {'reload': 'kimai.userUpdate'}) }} {% for entry in entries %} {{ widgets.user_avatar(entry) }} {{ widgets.username(entry) }} {{ entry.title }} {{ entry.email }} {% if entry.lastLogin is not null %}{{ entry.lastLogin|date_full }}{% endif %} {% set showUserRole = entry.roles|length == 1 %} {% for role in entry.roles %} {% if showUserRole or role != 'ROLE_USER' %} {{ widgets.label_role(role) }} {% endif %} {% endfor %} {% for pref in preferences %} {% set metaField = entry.preference(pref.name) %} {% if not metaField is null and metaField.value is not null and metaField.value is not empty %} {{ widgets.form_type_value(pref.type, metaField.value, entry) }} {% endif %} {% endfor %} {% if entry.teams|length > 0 %} {{ widgets.badge_counter(entry.teams|length) }} {% endif %} {{ widgets.label_visible(entry.enabled) }} {{ actions.user(entry, 'index') }} {% endfor %} {{ tables.data_table_footer(entries, 'admin_user_paginated') }} {% endif %} {% endblock %}