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.

67 lines
2.9KB

  1. {% extends '@LcSov/adminlte/layout.html.twig' %}
  2. {% block navbar_header %}
  3. {{ parent() }}
  4. {% set section_current = section_resolver.getCurrent() %}
  5. <nav class="carac navbar navbar-expand navbar-light main-header" style="border-color: {{ section_current.color }};">
  6. <ul class="navbar-nav left">
  7. {% for section in carac_get_sections() %}
  8. <li class="nav-item d-none d-sm-inline-block">
  9. {% set form_switch_section = carac_get_form_switch_section(section) %}
  10. {% form_theme form_switch_section '@LcSov/adminlte/crud/form_theme.html.twig' %}
  11. {{ form_start(form_switch_section) }}
  12. {{ form(form_switch_section) }}
  13. {{ form_end(form_switch_section) }}
  14. </li>
  15. {% endfor %}
  16. </ul>
  17. <ul class="navbar-nav ml-auto right">
  18. <li class="nav-item nav-switch-merchant">
  19. <i class="fa fa-store"></i>
  20. {% set form_switch_merchant = carac_get_form_switch_merchant('admin') %}
  21. {% form_theme form_switch_merchant '@LcSov/adminlte/crud/form_theme.html.twig' %}
  22. {{ form_start(form_switch_merchant) }}
  23. {{ form(form_switch_merchant) }}
  24. {{ form_end(form_switch_merchant) }}
  25. </li>
  26. </ul>
  27. </nav>
  28. {% endblock %}
  29. {% block append_body %}
  30. {# modal switch merchant #}
  31. {% set user = app.user %}
  32. {% set merchant_current = merchant_resolver.getCurrent() %}
  33. {% if(user.favoriteMerchant != merchant_current) %}
  34. {% embed '@LcSov/adminlte/embed/modal.twig' %}
  35. {% block id %}carac-modal-switch-merchant{% endblock %}
  36. {% block title %}
  37. Switch merchant
  38. {% endblock %}
  39. {% block body %}
  40. {% if not user.favoriteMerchant %}
  41. <p>Vous n'avez pas de marchand favoris.</p>
  42. {% endif %}
  43. {% if user.favoriteMerchant and user.favoriteMerchant != merchant_current %}
  44. <p>Vous n'êtes pas sur votre marchand par défaut.</p>
  45. {% endif %}
  46. {% endblock %}
  47. {% block footer %}
  48. {% set form_switch_merchant_button = carac_get_form_switch_merchant_button() %}
  49. {% form_theme form_switch_merchant_button '@LcSov/adminlte/crud/form_theme.html.twig' %}
  50. {{ form_start(form_switch_merchant_button) }}
  51. {{ form(form_switch_merchant_button) }}
  52. {{ form_end(form_switch_merchant_button) }}
  53. <button type="button" class="btn btn-primary"
  54. data-dismiss="modal">{{ 'action.switch_merchant'|trans }}</button>
  55. <button type="button" class="btn btn-default"
  56. data-dismiss="modal">{{ 'action.visit'|trans }}</button>
  57. {% endblock %}
  58. {% endembed %}
  59. {% endif %}
  60. {% endblock %}