{% 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 %} {% block page_title %}{{ 'admin_user.title'|trans }}{% endblock %} {% block page_subtitle %}{{ 'admin_user.subtitle'|trans }} {{ 'subtitle.amount'|trans({'%count%': entries.count}) }}{% endblock %} {% block page_actions %}{{ widgets.page_actions({'filter': '#collapseUserAdmin', 'plus-square': path('admin_user_create')}) }}{% endblock %} {% block main_before %} {{ toolbar.toolbar(toolbarForm, 'collapseUserAdmin') }} {% endblock %} {% block main %} {% if entries.count == 0 %} {{ widgets.callout('warning', 'error.no_entries_found') }} {% endif %} {{ tables.data_table_header({ 'label.id': 'hidden-xs', 'label.alias': '', 'label.username': 'hidden-xs', 'label.email': 'hidden-xs hidden-sm', 'label.title': 'hidden-xs', 'label.active': '', 'label.roles': '', 'label.actions': '', }) }} {% for entry in entries %} {{ entry.id }} {{ widgets.username(entry) }} {{ entry.username }} {{ entry.email }} {{ entry.title }} {{ widgets.label_visible(entry.active) }} {% for role in entry.roles %} {{ widgets.label_role(role) }} {% endfor %} {% set actionButtons = {} %} {% if is_granted('edit', entry) %} {% set actionButtons = {'edit': path('user_profile', {'username' : entry.username})}|merge(actionButtons) %} {% endif %} {% if is_granted('delete', entry) %} {% set actionButtons = actionButtons|merge({'trash': '#'}) %} {% endif %} {{ widgets.button_group(actionButtons) }} {% endfor %} {{ tables.data_table_footer(entries, 'admin_user_paginated') }} {% endblock %}