templates/base.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html>
  3.     {# TODO: mettre template nav en fonction du role utilisateur #}
  4.     <head>
  5.         <meta charset="UTF-8">
  6.         <title>{% block title %}Welcome!{% endblock %}</title>
  7.         <link rel="icon" type="image/png" href="/assets/GPU.png"/>
  8.         {# Run `composer require symfony/webpack-encore-bundle`
  9.            and uncomment the following Encore helpers to start using Symfony UX #}
  10.         {% block stylesheets %}
  11.             {{ encore_entry_link_tags('app') }}
  12.         {% endblock %}
  13.         {% block javascripts %}
  14.             {{ encore_entry_script_tags('app') }}
  15.         {% endblock %}
  16.         <!-- before the closing <body> tag -->
  17.         
  18.         {% if app.user is not null and app.user.contact is not null  %}
  19.         
  20.         {% set enteprises = app.user.contact.enterpriseContactPositions %}
  21.         {% if enterprises | length > 0 %}
  22.             {% set enterprise = enterprises[0] %}
  23.             {% if enterprise.mainColor != '#000000' %}
  24.             <style>
  25.                 .navbar{
  26.                     background-color: {{enterprise.mainColor}} !important;
  27.                 }
  28.                 .navbar .active::after {
  29.                     border-bottom: 15px solid {{enterprise.secondaryColor}} !important;
  30.                 }    
  31.                 .bg-footer {
  32.                     background-image: linear-gradient(to right, {{enterprise.mainColor}}, {{enterprise.secondaryColor}}) !important;
  33.                     z-index: 100;
  34.                     margin-top: 1em;
  35.                 }   
  36.                 table.dataTable thead th {
  37.                     background-color: {{enterprise.secondaryColor}} !important;
  38.                 }
  39.             </style>
  40.         {% endif %}
  41.         {% endif %}
  42.         {% endif %}
  43.     </head>
  44.     {% block body_head %}
  45.         {% if app.user.roles[0] in ['ROLE_ADMIN','ROLE_BUSINESSLINEMANAGER','ROLE_GROUPMANAGER'] %}
  46.             {% set body_class = 'body-admin' %}
  47.         {% elseif app.user.roles[0] == 'ROLE_CUSTOMER'  %}
  48.             {% set body_class = 'body-customer' %}
  49.         {% else %}
  50.             {% set body_class = 'body-provider' %}
  51.         {% endif %}
  52.         <body data-controller="hello" class="{{body_class}}">
  53.         <div class="modal" tabindex="-1" role="dialog"  id="leModal" >
  54.   <div class="modal-dialog" role="document">
  55.     <div class="modal-content">
  56.       <div class="modal-header">
  57.         <h5 class="modal-title"></h5>
  58.         <button type="button" class="close" data-dismiss="modal" aria-label="Close" data-action="click->hello#modalClose">
  59.           <span aria-hidden="true">&times;</span>
  60.         </button>
  61.       </div>
  62.       <div class="modal-body" id="toast-body" >
  63.         <p>Modal body text goes here.</p>
  64.       </div>
  65.     </div>
  66.   </div>
  67. </div>
  68.         {% endblock %}
  69.         {% block navbar %}                   
  70.         {% endblock %}
  71.         {% block message %}
  72.             <div class="container container-fluid">
  73.                 <div class="row justify-content-md-center">
  74.                     <div class="col-md-4">
  75.                         {% for label, messages in app.flashes %}
  76.                             {% for message in messages %}
  77.                                 <div class="alert alert-success" style="text-align:center">
  78.                                     {{ message }}
  79.                                 </div>
  80.                             {% endfor %}
  81.                         {% endfor %}
  82.                     </div>
  83.                 </div>
  84.             </div>
  85.         {% endblock %}
  86.         {% block modal %}
  87.             {% include ('common/_modal.html.twig') %}
  88.         {% endblock %}
  89.         {% include 'common/_panel.html.twig' %}
  90.         {% block body %}{% endblock %}
  91.         {% block js %}{% endblock %}
  92.         {% block footer %}
  93.             {% include('common/_footer.html.twig') %}
  94.         {% endblock %}
  95.     </body>
  96. </html>