{% extends 'base.html.twig' %}
{% block header %}
<nav class="navbar navbar-default navbar-fixed-top{% if app_environment == 'dev' %} navbar-inverse{% endif %}">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ path('app.home') }}">{% if app_environment == 'dev' %}TEST{% else %}DNWP{% endif %}</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
{% if app.user and is_granted('IS_AUTHENTICATED_FULLY') %}
<ul class="nav navbar-nav">
{% if is_granted('ROLE_INVENTORY') %}
<li{% if 'app.product.inventory' == app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.product.inventory') }}">{{ 'ui.inventory' | trans({}, 'Product') }}</a>
</li>
{% else %}
<li{% if 'app.sales_case.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.sales_case.index') }}">{{ 'entity.labels' | trans({}, 'SalesCase') }}</a>
</li>
<li{% if 'app.sales_journal.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.sales_journal.index') }}">{{ 'ui.sales_journals' | trans({}, 'PotentialCustomerCompany') }}</a>
</li>
<li class="dropdown{% if 'app.product.' in app.request.attributes.get('_route') or 'app.product_configuration_items' in app.request.attributes.get('_route') or 'app.sales_item.' in app.request.attributes.get('_route') %} active{% endif %}">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ 'entity.labels' | trans({}, 'SalesItem') }} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li{% if 'app.product.index' == app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.product.index') }}">{{ 'ui.products_and_prices' | trans({}, 'Product') }}</a>
</li>
{% if is_granted('ROLE_ADMIN') %}
<li{% if 'app.product_configuration_items' == app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.product_configuration_items') }}">{{ 'entity.labels' | trans({}, 'ProductConfigurationItem') }}</a>
</li>
{% endif %}
<li{% if 'app.product.inventory' == app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.product.inventory') }}">{{ 'ui.inventory' | trans({}, 'Product') }}</a>
</li>
<li{% if 'app.component_inventory.index' == app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.component_inventory.index') }}">{{ 'ui.componentInventory' | trans({}, 'ComponentInventoryItem') }}</a>
</li>
<li role="separator" class="divider"></li>
<li class="dropdown-header">Incomplete Sales Items</li>
<li{% if 'app.sales_item.incomplete.header_platform_type' == app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.sales_item.incomplete.header_platform_type') }}">Missing header, platform or type</a>
</li>
<li{% if 'app.sales_item.incomplete.license_info' == app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.sales_item.incomplete.license_info') }}">Missing license info</a>
</li>
<li{% if 'app.sales_item.connection_master' == app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.sales_item.connection_master') }}">Connection Master Fix</a>
</li>
</ul>
</li>
<li{% if 'app.company.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.company.index') }}">{{ 'ui.customers' | trans({}, 'Company') }}</a>
</li>
<li{% if 'app.supplier.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.supplier.index') }}">{{ 'entity.labels' | trans({}, 'Supplier') }}</a>
</li>
<li class="dropdown{% if 'app.setting.' in app.request.attributes.get('_route') or 'app.bank_account.' in app.request.attributes.get('_route') or 'app.user.' in app.request.attributes.get('_route') %} active{% endif %}">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ 'entity.labels' | trans({}, 'Setting') }} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li{% if 'app.setting.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.setting.index') }}">{{ 'entity.labels' | trans({}, 'Setting') }}</a>
</li>
<li{% if 'app.bank_account.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.bank_account.index') }}">{{ 'entity.labels' | trans({}, 'BankAccount') }}</a>
</li>
{% if is_granted('ROLE_ADMIN') %}
<li{% if 'app.user.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
<a href="{{ path('app.user.index') }}">{{ 'entity.labels' | trans({}, 'User') }}</a>
</li>
{% endif %}
</ul>
</li>
<li class="dropdown{% if 'app.report.' in app.request.attributes.get('_route') %} active{% endif %}">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ 'entity.labels' | trans({}, 'Report') }} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
{% for reportClass in get_reports() %}
{% set reportName = constant(reportClass ~ '::NAME') %}
{% if is_granted('read', reportClass) %}
<li><a href="{{ path('app.report.' ~ reportName) }}">{{ ('ui.type.' ~ reportName) | trans({}, 'Report') }}</a></li>
{% endif %}
{% endfor %}
</ul>
</li>
{% endif %}
</ul>
{% endif %}
<ul class="nav navbar-nav navbar-right">
{% if app.user and is_granted('IS_AUTHENTICATED_FULLY') %}
{{ render(controller('App\\Controller\\DefaultController::notificationsAlertAction')) }}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ app.user.name }} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ path('nucleos_user_change_password') }}">{{ 'ui.change_password' | trans({}, 'User') }}</a></li>
<li class="divider"></li>
<li><a href="{{ path('nucleos_user_security_logout') }}"><i class="fa fa-sign-out"></i> {{ 'layout.logout' | trans({}, 'NucleosUserBundle') }}</a></li>
</ul>
</li>
{% else %}
<li><a href="{{ path('nucleos_user_security_login') }}"><i class="fa fa-sign-in"></i> {{ 'layout.login' | trans({}, 'NucleosUserBundle') }}</a></li>
{% endif %}
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
{% block breadcrumb_wide %}{% endblock %}
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-xs-12">
{% block breadcrumb %}{% endblock %}
{% block alerts %}
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="alert alert-success alert-dismissable">
<button data-dismiss="alert" class="close" type="button">×</button>
{{ flashMessage | raw }}
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="alert alert-info alert-dismissable">
<button data-dismiss="alert" class="close" type="button">×</button>
{{ flashMessage | raw }}
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('warning') %}
<div class="alert alert-warning alert-dismissable">
<button data-dismiss="alert" class="close" type="button">×</button>
{{ flashMessage | raw }}
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('error') %}
<div class="alert alert-danger alert-dismissable">
<button data-dismiss="alert" class="close" type="button">×</button>
{{ flashMessage | raw }}
</div>
{% endfor %}
{% endblock alerts %}
</div>
</div>
</div>
{% endblock %}