You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user-switch.html.twig 1.1KB

4 年之前
4 年之前
123456789101112131415161718192021
  1. {% if is_granted('ROLE_SUPER_ADMIN') %}
  2. {% if 'localhost' in app.request.getSchemeAndHttpHost() %}
  3. {% set href = app.request.getSchemeAndHttpHost()~ '?_switch_user='~item.username %}
  4. {% else %}
  5. {% set href = merchantUtils.merchantCurrent.getMerchantConfig('url')~ '?_switch_user='~item.username %}
  6. {% endif %}
  7. {% if is_dropdown %}
  8. <a class="btn dropdown-item {{ action.css_class|default('btn-default') }}" href="{{ href }}"
  9. target="_blank">
  10. {%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
  11. {{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}
  12. </a>
  13. {% else %}
  14. <a class="btn {{ action.css_class|default('btn-default') }}" data-toggle="tooltip"
  15. title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}"
  16. href="{{ href }}" target="_blank">
  17. {%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
  18. </a>
  19. {% endif %}
  20. {% endif %}