{% extends 'Layouts/default.html.twig' %} {% block title %}{{ 'app.global.user.list.users'|trans }}{% endblock %} {% block search %} {% include 'Search/list.html.twig' %} {% endblock %} {% block toolbar_actions %} {% if true == is_granted('ROLE_SUPPORT') and 'customer' == instance %} {% if isDbReachable %} {{ 'app.global.user.buttons.migration'|trans }} {% else %}
{{ 'app.global.user.migration.warning_unreachable_db'|trans }}
{% endif %} {% endif %} {% set canAddShopManager = userTypeShopManager != instance or (not isSwitchedByDeveloper and not isDeveloper) %} {% set displayCustomerForm = (isShopManager and 'customer' == instance) %} {% set displayStaffForm = (isAdministrator and instance in ['manager', 'support', 'developer', 'shop-manager']) %} {% set displayShopManagerForm = (isSupport or isManager) and 'shop-manager' == instance %} {% set targetKey = { 'customer': 'clients', 'manager': 'managers', 'shop-manager': 'shop_owners', 'developer': 'developers', 'support': 'supports' }[instance] ?? 'supports' %} {% if (canAddShopManager and (displayCustomerForm or displayStaffForm or displayShopManagerForm)) %} {{ ("app.global.user.#{targetKey}.new.title")|trans }} {% endif %} {% endblock %} {% block body %} {% include 'List/switch_table_list.html.twig' with {'totalCountPagination': users.getPaginationData.totalCount} %}
{% include 'Security/User/Lists/table.html.twig' with { 'users': users } %} {% include 'Security/User/Lists/cards.html.twig' with { 'users': users } %} {% include 'List/pagination.html.twig' with { 'data' : users } %}
{% endblock %} {% block modals %} {% set canAddShopManager = userTypeShopManager != instance or (not isSwitchedByDeveloper and not isDeveloper) %} {% set displayCustomerForm = (isShopManager and 'customer' == instance) %} {% set displayStaffForm = (isAdministrator and instance in ['manager', 'support', 'developer', 'shop-manager']) %} {% set displayShopManagerForm = (isSupport or isManager) and 'shop-manager' == instance %} {% if (canAddShopManager and (displayCustomerForm or displayStaffForm or displayShopManagerForm)) %} {% include 'Modal/form.html.twig' with { 'id': 'user', } %} {% endif %} {% if true == is_granted('ROLE_SUPPORT') and migrationForm is defined and isDbReachable %} {% include 'Modal/form.html.twig' with { 'title':'app.global.user.migration.title'|trans, 'id': 'migration', 'form': migrationForm, } %} {% endif %} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}