<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}{{ 'PowerVoice'|trans }}{% endblock %}</title>
<link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet" />
<link href="{{ asset('css/selectize.bootstrap4.css') }}" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.1/cookieconsent.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css">
<link href="{{ asset('css/style.css') }}" rel="stylesheet" />
{% block stylesheets %}{% endblock %}
</head>
<body>
<div class="container-fluid">
{% if app.user %}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar">
{% if app.user.className == 'App\\Entity\\User' %}
<a class="navbar-brand" href="{{ path('manager_home') }}"><img src="{{ asset('img/powerling.svg') }}" alt="PowerVoice" /></a>
{% elseif app.user.className == 'App\\Entity\\Resource' %}
<a class="navbar-brand" href="{{ path('home') }}"><img src="{{ asset('img/powerling.svg') }}" alt="PowerVoice" /></a>
{% endif %}
<ul class="navbar-nav">
{% if is_granted('ROLE_RESOURCE') and app.user.status == constant('App\\Entity\\Resource::STATUS_VALIDATED') %}
<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>
<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>
{# <li class="nav-item"><a href="{{ path('pricing') }}" class="nav-link {% if app.request.attributes.get('item') == 'pricing' %}active{% endif %}">{{ 'Pricing'|trans }}</a></li> #}
<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>
{% endif %}
{% if is_granted('ROLE_ADMIN') %}
<li class="nav-item dropdown">
<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>
<div class="dropdown-menu" aria-labelledby="manager-record-drodown">
{# <a href="{{ path('admin_compta_home') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'admin-compta' %}active{% endif %}">{{ 'Exports'|trans }}</a> #}
<a href="{{ path('admin_costs_records') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'admin-cost-records' %}active{% endif %}">{{ 'Costs (Record)'|trans }}</a>
<a href="{{ path('admin_costs_scenarios') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'admin-cost-scenarios' %}active{% endif %}">{{ 'Costs (Scenario)'|trans }}</a>
<a href="{{ path('admin_costs_resources') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'admin_costs_resources' %}active{% endif %}">{{ 'Costs (Resource)'|trans }}</a>
</div>
</li>
<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>
<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>
{% endif %}
{% if is_granted('ROLE_VALIDATOR') %}
<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>
{% endif %}
{% if is_granted('ROLE_VALIDATOR_RECORD') or is_granted('ROLE_PROJECT_MANAGER') %}
<li class="nav-item dropdown">
<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>
<div class="dropdown-menu" aria-labelledby="manager-record-drodown">
<a href="{{ path('manager_record_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-record' %}active{% endif %}">{{ 'List'|trans }}</a>
{% if is_granted('ROLE_MANAGER') or is_granted('ROLE_PROJECT_MANAGER') %}
<a href="{{ path('manager_project_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-project' %}active{% endif %}">{{ 'Projects'|trans }}</a>
{% endif %}
{% if is_granted('ROLE_MANAGER') %}
<a href="{{ path('manager_record_monitoring') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-record-monitoring' %}active{% endif %}">{{ 'Monitoring'|trans }}</a>
{% endif %}
</div>
</li>
{% endif %}
{% if is_granted('ROLE_VALIDATOR_SCENARIO') or is_granted('ROLE_PROJECT_MANAGER') %}
<li class="nav-item dropdown">
<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>
<div class="dropdown-menu" aria-labelledby="manager-record-drodown">
<a href="{{ path('manager_scenario_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-scenario' %}active{% endif %}">{{ 'List'|trans }}</a>
{% if is_granted('ROLE_MANAGER') or is_granted('ROLE_PROJECT_MANAGER') %}
<a href="{{ path('manager_scenario_type_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-scenario-type' %}active{% endif %}">{{ 'Types'|trans }}</a>
{% endif %}
{% if is_granted('ROLE_MANAGER') %}
<a href="{{ path('manager_scenario_project_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-scenario-project' %}active{% endif %}">{{ 'Projects'|trans }}</a>
<a href="{{ path('manager_scenario_monitoring') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-scenario-monitoring' %}active{% endif %}">{{ 'Monitoring'|trans }}</a>
{% endif %}
</div>
</li>
{% endif %}
{% if is_granted('ROLE_ADMIN') %}
<li class="nav-item dropdown">
<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>
<div class="dropdown-menu" aria-labelledby="manager-record-drodown">
<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>
<a href="{{ path('manager_accent_list') }}" class="dropdown-item {% if app.request.attributes.get('item') == 'manager-accent' %}active{% endif %}">{{ 'Accents'|trans }}</a>
</div>
</li>
{% endif %}
</ul>
<ul class="list-no-style mr-3">
<li class="nav-item ml-auto">
<div class="dropdown connected pt-0" id="language-selector">
<button class="btn dropdown-toggle" id="dropdown-language" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ app.request.locale|locale_name(app.request.locale)|capitalize }}
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-language">
{% for locale in supported_locales|split('|') %}
<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>
{% endfor %}
</div>
</div>
</li>
{% if is_granted('ROLE_VALIDATOR') or is_granted('ROLE_VALIDATOR_RECORD') or is_granted('ROLE_VALIDATOR_SCENARIO') or is_granted('ROLE_PROJECT_MANAGER') %}
<li class="nav-item">
<div class="dropdown pt-0">
<button class="btn btn-primary dropdown-toggle" id="dropdown-language" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ app.user.username }}
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-language">
<a href="{{ path('user_update') }}" class="dropdown-item">{{ 'Account'|trans }}</a>
<a href="{{ path('logout') }}" class="dropdown-item text-danger">{{ 'Logout'|trans }}</a>
</div>
</div>
</li>
{% elseif is_granted('ROLE_RESOURCE') %}
<li class="nav-item">
<div class="dropdown pt-0">
<button class="btn btn-primary dropdown-toggle" id="dropdown-language" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ app.user.firstname }} {{ app.user.lastname }}
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-language">
<a href="{{ path('resource_view') }}" class="dropdown-item">{{ 'Account'|trans }}</a>
<a href="{{ path('logout') }}" class="dropdown-item text-danger">{{ 'Logout'|trans }}</a>
</div>
</div>
</li>
{% endif %}
</ul>
</div>
</nav>
{% else %}
<div class="dropdown" id="language-selector">
<button class="btn dropdown-toggle" id="dropdown-language" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ app.request.locale|locale_name(app.request.locale)|capitalize }}
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-language">
{% for locale in supported_locales|split('|') %}
<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>
{% endfor %}
</div>
</div>
{% endif %}
{% for type, flashes in app.session.flashbag.all %}
{% for flash in flashes %}
<div class="alert alert-{{ type }} fade in show rounded-0">
{{ flash }}
</div>
{% endfor %}
{% endfor %}
<div class="sub-container">
{% block body %}{% endblock %}
</div>
</div>
</body>
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.1/cookieconsent.min.js"></script>
<script src="{{ asset('js/jquery.min.js') }}"></script>
<script src="{{ asset('js/popper.min.js') }}"></script>
<script src="{{ asset('js/bootstrap.min.js') }}"></script>
<script src="{{ asset('js/selectize.min.js') }}"></script>
<script src="{{ asset('js/global.js') }}"></script>
{% block javascripts %}{% endblock %}
</html>