{% extends 'base.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% import "macros/datatables.html.twig" as tables %} {% block main %} {% set tableName = 'kiosk' %} {% set columns = { 'avatar': {'class': 'alwaysVisible w-min', 'title': null, 'orderBy': false}, 'username': {'class': 'alwaysVisible', 'orderBy': false}, 'codes': {'title': 'kiosk.user_codes'|trans, 'class': 'd-none d-sm-table-cell', 'orderBy': false}, 'actions': {'class': 'actions alwaysVisible'}, } %} {% if entries|length == 0 %} {{ widgets.callout('warning', 'error.no_entries_found') }} {% else %} {{ tables.datatable_header(tableName, columns, null, {'columnConfig': false}) }} {% for entry in entries %} {% set user = entry.user %} {% set can_edit = is_granted('kiosk', user) %} {{ widgets.user_avatar(user, false) }} {{ widgets.username(user) }} {% for auth in entry.auth %} {{ widgets.label(encoder[auth.type]|replace({'Barcode: ': ''}), null, (can_edit ? auth.code : null)) }} {% endfor %} {% set actions = {} %} {% if is_granted('kiosk', user) %} {% set actions = actions|merge({'edit': {'url': path('user_barcode', {'username': user.userIdentifier})}}) %} {% endif %} {% set event = trigger('actions.kiosk_profile', {'actions': actions, 'view': 'index', 'user': user}) %} {{ widgets.table_actions(event.payload.actions) }} {% endfor %} {{ tables.data_table_footer(entries) }} {% endif %} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}