templates/base.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html data-bs-theme="light">
  3.     <head>
  4.         <meta name="viewport" content="width=device-width, initial-scale=1.0">
  5.         <meta charset="UTF-8">
  6.         <title>{% block title %}{{ titolo }}{% endblock %}</title>
  7.         <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>">
  8.         {# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
  9.         {% block stylesheets %}
  10.             {{ encore_entry_link_tags('app') }}
  11.             {# Fogli di stile personalizzati #}
  12.             {# Includere Bootstrap CSS #}
  13.             <link rel="stylesheet" href="{{ asset('css/bootstrap.min.css') }}">
  14.             <link rel="stylesheet" href="{{ asset('bootstrap-icons/bootstrap-icons.min.css') }}">
  15.         {% endblock %}
  16.         {% block javascripts %}
  17.             {{ encore_entry_script_tags('app') }}
  18.             {# Includere Bootstrap JS #}
  19.             <script src="{{ asset('js/bootstrap.bundle.min.js') }}"></script>
  20.             <script>
  21.                 document.addEventListener("DOMContentLoaded", function() {
  22.                     var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
  23.                     var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
  24.                         return new bootstrap.Tooltip(tooltipTriggerEl);
  25.                     });
  26.                 });
  27.             </script>
  28.         {% endblock %}
  29.     </head>
  30.     <body>
  31.         <nav id="navbar" class="navbar navbar-dark bg-dark no-print">
  32.             <div class="container-fluid">
  33.                 <!-- Titolo Navbar -->
  34.                 <h1 class="navbar-brand fs-3">{{ titolo }}</h1>
  35.                 <!-- Bottone per aprire il menu su mobile -->
  36.                 <button class="navbar-toggler btn-lg" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasDarkNavbar" aria-controls="offcanvasDarkNavbar" aria-label="Toggle navigation">
  37.                     <span class="navbar-toggler-icon"></span>
  38.                 </button>
  39.                 <!-- Offcanvas Menu -->
  40.                 <div class="offcanvas offcanvas-end text-bg-dark" tabindex="-1" id="offcanvasDarkNavbar" aria-labelledby="offcanvasDarkNavbarLabel">
  41.                     <div class="offcanvas-header">
  42.                         <h5 class="offcanvas-title fs-3" id="offcanvasDarkNavbarLabel">Gestione Cantiere!</h5>
  43.                         <button type="button" class="btn-close btn-close-white" data-bs-dismiss="offcanvas" aria-label="Close"></button>
  44.                     </div>
  45.                     <div class="offcanvas-body">
  46.                         <ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
  47.                             <li class="nav-item">
  48.                                 <a class="nav-link fs-4 active" href="/">🏠 Pagina iniziale</a>
  49.                             </li>
  50.                             {% if app.user is not null and app.user.roles is not empty %}
  51.                                 {% if 'ROLE_REPORT' not in app.user.roles %}
  52.                             <li class="nav-item">
  53.                                 <a class="nav-link fs-4 active" href="{{ path('app_lavori_edit', {'tipo': 'new', 'id': 0}) }}">➕ Nuova attività</a>
  54.                             </li>
  55.                                 {% endif %}
  56.                             {% endif %}
  57.                             {% if app.user is not null and app.user.roles is not empty %}
  58.                                 {% if 'ROLE_OPERAIO' in app.user.roles or 'ROLE_OPERATORE' in app.user.roles or 'ROLE_AMMINISTRATORE' in app.user.roles %}
  59.                             <li class="nav-item">
  60.                                 <a class="nav-link fs-4 active" href="/lavori">📋 Elenco attività</a>
  61.                             </li>
  62.                                 {% endif %}
  63.                             {% endif %}
  64.                             {% if app.user is not null and app.user.roles is not empty %}
  65.                                 {% if 'ROLE_OPERATORE' in app.user.roles or 'ROLE_REPORT' in app.user.roles or 'ROLE_AMMINISTRATORE' in app.user.roles %}
  66.                             <li class="nav-item">
  67.                                 <a class="nav-link fs-4 active" href="/report">📊 Report</a>
  68.                             </li>
  69.                                 {% endif %}
  70.                             {% endif %}
  71.                             {% if app.user is not null and app.user.roles is not empty %}
  72.                                 {% if 'ROLE_OPERATORE' in app.user.roles or 'ROLE_AMMINISTRATORE' in app.user.roles %}
  73.                             <li class="nav-item">
  74.                                 <a class="nav-link fs-4 active" href="/impostazioni">⚙️ Impostazioni</a>
  75.                             </li>
  76.                                 {% endif %}
  77.                             {% endif %}
  78.                             <li class="nav-item">
  79.                                 <a class="nav-link fs-4" href="/logout">🚪 Esci</a>
  80.                             </li>
  81.                         </ul>
  82.                     </div>
  83.                 </div>
  84.             </div>
  85.         </nav>
  86.         {% block body %}{% endblock %}
  87.     </body>
  88.     <style>
  89.         @media print {
  90.             .no-print {
  91.                 display: none;
  92.             }
  93.         }
  94.     </style>
  95. <style>
  96. </style>
  97. </html>