templates/base.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <meta charset="UTF-8">
  5.         <title>{% block title %}{{ 'PowerVoice'|trans }}{% endblock %}</title>
  6.         <link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet" />
  7.         <link href="{{ asset('css/selectize.bootstrap4.css') }}" rel="stylesheet" />
  8.         <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.1/cookieconsent.min.css" />
  9.         <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css">
  10.         <link href="{{ asset('css/style.css') }}" rel="stylesheet" />
  11.         {% block stylesheets %}{% endblock %}
  12.     </head>
  13.     <body>
  14.         <div class="container-fluid">
  15.         {% if app.user %}
  16.             <nav class="navbar navbar-expand-lg navbar-light bg-light">
  17.                 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
  18.                     <span class="navbar-toggler-icon"></span>
  19.                 </button>
  20.                 <div class="collapse navbar-collapse" id="navbar">
  21.                 {% if app.user.className == 'App\\Entity\\User' %}
  22.                     <a class="navbar-brand" href="{{ path('manager_home') }}"><img src="{{ asset('img/powerling.svg') }}" alt="PowerVoice" /></a>
  23.                 {% elseif app.user.className == 'App\\Entity\\Resource' %}
  24.                     <a class="navbar-brand" href="{{ path('home') }}"><img src="{{ asset('img/powerling.svg') }}" alt="PowerVoice" /></a>
  25.                 {% endif %}
  26.                     <ul class="navbar-nav">
  27.                     {% if is_granted('ROLE_RESOURCE') and app.user.status == constant('App\\Entity\\Resource::STATUS_VALIDATED') %}
  28.                         <li class="nav-item"><a href="{{ path('record_list') }}" class="nav-link {% if app.request.attributes.get('item') == 'record' %}active{% endif %}">{{ 'Records'|trans }}</a></li>
  29.                         <li class="nav-item"><a href="{{ path('scenario_list') }}" class="nav-link {% if app.request.attributes.get('item') == 'scenario' %}active{% endif %}">{{ 'Scenarios'|trans }}</a></li>
  30.                         {# <li class="nav-item"><a href="{{ path('pricing') }}" class="nav-link {% if app.request.attributes.get('item') == 'pricing' %}active{% endif %}">{{ 'Pricing'|trans }}</a></li> #}
  31.                         <li class="nav-item"><a href="{{ path('payment_history') }}" class="nav-link font-weight-bold {% if app.request.attributes.get('item') == 'payment' %}active{% endif %}">{{ 'My payments'|trans }}</a></li>
  32.                     {% endif %}
  33.                     {% if is_granted('ROLE_ADMIN') %}
  34.                         <li class="nav-item dropdown">
  35.                             <a class="nav-link dropdown-toggle {% if app.request.attributes.get('item') in ['admin-compta', 'admin-cost-records', 'admin-cost-scenarios', 'admin-cost-resources'] %}active{% endif %}" href="#" id="manager-record-dropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ 'Accounting'|trans }}</a>
  36.                             <div class="dropdown-menu" aria-labelledby="manager-record-drodown">
  37.                                 {# <a href="{{ path('admin_compta_home') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'admin-compta' %}active{% endif %}">{{ 'Exports'|trans }}</a> #}
  38.                                 <a href="{{ path('admin_costs_records') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'admin-cost-records' %}active{% endif %}">{{ 'Costs (Record)'|trans }}</a>
  39.                                 <a href="{{ path('admin_costs_scenarios') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'admin-cost-scenarios' %}active{% endif %}">{{ 'Costs (Scenario)'|trans }}</a>
  40.                                 <a href="{{ path('admin_costs_resources') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'admin_costs_resources' %}active{% endif %}">{{ 'Costs (Resource)'|trans }}</a>
  41.                             </div>
  42.                         </li>
  43.                         <li class="nav-item"><a href="{{ path('admin_delivery') }}" class="nav-link {% if app.request.attributes.get('item') == 'admin-delivery' %}active{% endif %}">{{ 'Delivery'|trans({}, 'admin') }}</a></li>
  44.                         <li class="nav-item"><a href="{{ path('admin_user_list') }}" class="nav-link {% if app.request.attributes.get('item') == 'admin-user' %}active{% endif %}">{{ 'Users'|trans }}</a></li>
  45.                     {% endif %}
  46.                     {% if is_granted('ROLE_VALIDATOR') %}
  47.                         <li class="nav-item"><a href="{{ path('manager_resource_list') }}" class="nav-link {% if app.request.attributes.get('item') == 'manager-resource' %}active{% endif %}">{{ 'Resources'|trans }}</a></li>
  48.                     {% endif %}
  49.                     {% if is_granted('ROLE_VALIDATOR_RECORD') or is_granted('ROLE_PROJECT_MANAGER') %}
  50.                         <li class="nav-item dropdown">
  51.                             <a class="nav-link dropdown-toggle {% if app.request.attributes.get('item') in ['manager-record', 'manager-project'] %}active{% endif %}" href="#" id="manager-record-dropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ 'Records'|trans }}</a>
  52.                             <div class="dropdown-menu" aria-labelledby="manager-record-drodown">
  53.                                 <a href="{{ path('manager_record_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-record' %}active{% endif %}">{{ 'List'|trans }}</a>
  54.                                 {% if is_granted('ROLE_MANAGER') or is_granted('ROLE_PROJECT_MANAGER') %}
  55.                                     <a href="{{ path('manager_project_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-project' %}active{% endif %}">{{ 'Projects'|trans }}</a>
  56.                                 {% endif %}
  57.                                 {% if is_granted('ROLE_MANAGER') %}
  58.                                 <a href="{{ path('manager_record_monitoring') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-record-monitoring' %}active{% endif %}">{{ 'Monitoring'|trans }}</a>
  59.                                 {% endif %}
  60.                             </div>
  61.                         </li>
  62.                     {% endif %}
  63.                     {% if is_granted('ROLE_VALIDATOR_SCENARIO') or is_granted('ROLE_PROJECT_MANAGER') %}
  64.                         <li class="nav-item dropdown">
  65.                             <a class="nav-link dropdown-toggle {% if app.request.attributes.get('item') in ['manager-scenario', 'manager-scenario-type', 'manager-scenario-project', 'manager-scenario-monitoring'] %}active{% endif %}" href="#" id="manager-scenario-dropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ 'Scenario'|trans }}</a>
  66.                             <div class="dropdown-menu" aria-labelledby="manager-record-drodown">
  67.                                 <a href="{{ path('manager_scenario_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-scenario' %}active{% endif %}">{{ 'List'|trans }}</a>
  68.                                 {% if is_granted('ROLE_MANAGER') or is_granted('ROLE_PROJECT_MANAGER') %}
  69.                                 <a href="{{ path('manager_scenario_type_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-scenario-type' %}active{% endif %}">{{ 'Types'|trans }}</a>
  70.                                 {% endif %}
  71.                                 {% if is_granted('ROLE_MANAGER') %}
  72.                                 <a href="{{ path('manager_scenario_project_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-scenario-project' %}active{% endif %}">{{ 'Projects'|trans }}</a>
  73.                                 <a href="{{ path('manager_scenario_monitoring') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-scenario-monitoring' %}active{% endif %}">{{ 'Monitoring'|trans }}</a>
  74.                                 {% endif %}
  75.                             </div>
  76.                         </li>
  77.                     {% endif %}
  78.                     {% if is_granted('ROLE_ADMIN') %}
  79.                         <li class="nav-item dropdown">
  80.                             <a class="nav-link dropdown-toggle {% if app.request.attributes.get('item') in ['manager-scenario-nda-files', 'manager-accent'] %}active{% endif %}" href="#" id="manager-scenario-dropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ 'Admin'|trans }}</a>
  81.                             <div class="dropdown-menu" aria-labelledby="manager-record-drodown">
  82.                                 <a href="{{ path('manager_scenario_nda_files_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-scenario-nda-files' %}active{% endif %}">NDA</a>
  83.                                 <a href="{{ path('manager_accent_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-accent' %}active{% endif %}">{{ 'Accents'|trans }}</a>
  84.                             </div>
  85.                         </li>
  86.                     {% endif %}
  87.                     </ul>
  88.                     <ul class="list-no-style mr-3">
  89.                         <li class="nav-item ml-auto">
  90.                             <div class="dropdown connected pt-0" id="language-selector">
  91.                                 <button class="btn dropdown-toggle" id="dropdown-language" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  92.                                     {{ app.request.locale|locale_name(app.request.locale)|capitalize }}
  93.                                 </button>
  94.                                 <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-language">
  95.                                 {% for locale in supported_locales|split('|') %}
  96.                                     <a class="dropdown-item" href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge({'_locale': locale})) }}">{{ locale|locale_name(locale)|capitalize }}</a>
  97.                                 {% endfor %}
  98.                                 </div>
  99.                             </div>
  100.                         </li>
  101.                     {% if is_granted('ROLE_VALIDATOR') or is_granted('ROLE_VALIDATOR_RECORD') or is_granted('ROLE_VALIDATOR_SCENARIO') or is_granted('ROLE_PROJECT_MANAGER') %}
  102.                     <li class="nav-item">
  103.                         <div class="dropdown pt-0">
  104.                             <button class="btn btn-primary dropdown-toggle" id="dropdown-language" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  105.                                 {{ app.user.username }}
  106.                             </button>
  107.                             <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-language">
  108.                                 <a href="{{ path('user_update') }}" class="dropdown-item">{{ 'Account'|trans }}</a>
  109.                                 <a href="{{ path('logout') }}" class="dropdown-item text-danger">{{ 'Logout'|trans }}</a>
  110.                             </div>
  111.                         </div>
  112.                     </li>
  113.                     {% elseif is_granted('ROLE_RESOURCE') %}
  114.                     <li class="nav-item">
  115.                         <div class="dropdown pt-0">
  116.                             <button class="btn btn-primary dropdown-toggle" id="dropdown-language" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  117.                                 {{ app.user.firstname }} {{ app.user.lastname }}
  118.                             </button>
  119.                             <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-language">
  120.                                 <a href="{{ path('resource_view') }}" class="dropdown-item">{{ 'Account'|trans }}</a>
  121.                                 <a href="{{ path('logout') }}" class="dropdown-item text-danger">{{ 'Logout'|trans }}</a>
  122.                             </div>
  123.                         </div>
  124.                     </li>
  125.                     {% endif %}
  126.                     </ul>
  127.                 </div>
  128.             </nav>
  129.         {% else %}
  130.             <div class="dropdown" id="language-selector">
  131.                 <button class="btn dropdown-toggle" id="dropdown-language" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  132.                     {{ app.request.locale|locale_name(app.request.locale)|capitalize }}
  133.                 </button>
  134.                 <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-language">
  135.                 {% for locale in supported_locales|split('|') %}
  136.                     <a class="dropdown-item" href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge({'_locale': locale})) }}">{{ locale|locale_name(locale)|capitalize }}</a>
  137.                 {% endfor %}
  138.                 </div>
  139.             </div>
  140.         {% endif %}
  141.         {% for type, flashes in app.session.flashbag.all %}
  142.             {% for flash in flashes %}
  143.             <div class="alert alert-{{ type }} fade in show rounded-0">
  144.                 {{ flash }}
  145.             </div>
  146.             {% endfor %}
  147.         {% endfor %}
  148.             <div class="sub-container">
  149.                 {% block body %}{% endblock %}
  150.             </div>
  151.         </div>
  152.     </body>
  153.     <script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.1/cookieconsent.min.js"></script>
  154.     <script src="{{ asset('js/jquery.min.js') }}"></script>
  155.     <script src="{{ asset('js/popper.min.js') }}"></script>
  156.     <script src="{{ asset('js/bootstrap.min.js') }}"></script>
  157.     <script src="{{ asset('js/selectize.min.js') }}"></script>
  158.     <script src="{{ asset('js/global.js') }}"></script>
  159.     {% block javascripts %}{% endblock %}
  160. </html>