templates/front/main/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Hello MainController!{% endblock %}
  3. {% block body %}
  4. <style>
  5.     .example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
  6.     .example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
  7. </style>
  8.     {% block header %}
  9.         <div style="" >
  10.             {% if app.user %}
  11.                 {# TODO Optimize the main page, is it fully the same for roles B2C, B2B, B2B_SUB, ...  ?? #}
  12.                 {% if  "ROLE_B2C" in app.user.roles %}
  13.                     <a href="" style="padding-right: 15px">
  14.                         {{ app.user.email}}
  15.                     </a>
  16.                 {% endif %}
  17.                 {% if  "ROLE_B2B_SUB" in app.user.roles or "ROLE_B2B_SUB" in app.user.roles or "ROLE_B2CORP" in app.user.roles or "ROLE_B2CORP_ADH" in app.user.roles   %}
  18.                     <a href="" target="_blank" style="padding-right: 15px">
  19.                         {{ app.user.email}}
  20.                     </a>
  21.                 {% endif %}
  22.                 <a  class="btn btn-outline-success" href="{{ path('app_logout') }}">Logout</a>
  23.             {% else %}
  24.                 <a href="{{ path('app_login') }}" style="padding-right: 15px">
  25.                     Se connecter
  26.                 </a>
  27.                 <a href="{{ path('app_register') }}" style="padding-right: 15px">
  28.                     S'inscrire
  29.                 </a>
  30.                 <a href="/login/btob" style="padding-right: 15px">
  31.                     Espace pro
  32.                 </a>
  33.             {% endif %}
  34.         </div>
  35. <div class="example-wrapper">
  36.     <h1>Front End Page ✅</h1>
  37. </div>
  38.     {% endblock %}
  39. {% endblock %}