templates/layout.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block header %}
  3.     <nav class="navbar navbar-default navbar-fixed-top{% if app_environment == 'dev' %} navbar-inverse{% endif %}">
  4.         <div class="container">
  5.             <!-- Brand and toggle get grouped for better mobile display -->
  6.             <div class="navbar-header">
  7.                 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
  8.                     <span class="sr-only">Toggle navigation</span>
  9.                     <span class="icon-bar"></span>
  10.                     <span class="icon-bar"></span>
  11.                     <span class="icon-bar"></span>
  12.                 </button>
  13.                 <a class="navbar-brand" href="{{ path('app.home') }}">{% if app_environment == 'dev' %}TEST{% else %}DNWP{% endif %}</a>
  14.             </div>
  15.             <!-- Collect the nav links, forms, and other content for toggling -->
  16.             <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
  17.                 {% if app.user and is_granted('IS_AUTHENTICATED_FULLY') %}
  18.                     <ul class="nav navbar-nav">
  19.                         {% if is_granted('ROLE_INVENTORY') %}
  20.                             <li{% if 'app.product.inventory' == app.request.attributes.get('_route') %} class="active"{% endif %}>
  21.                                 <a href="{{ path('app.product.inventory') }}">{{ 'ui.inventory' | trans({}, 'Product') }}</a>
  22.                             </li>
  23.                         {% else %}
  24.                             <li{% if 'app.sales_case.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
  25.                                 <a href="{{ path('app.sales_case.index') }}">{{ 'entity.labels' | trans({}, 'SalesCase') }}</a>
  26.                             </li>
  27.                             <li{% if 'app.sales_journal.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
  28.                                 <a href="{{ path('app.sales_journal.index') }}">{{ 'ui.sales_journals' | trans({}, 'PotentialCustomerCompany') }}</a>
  29.                             </li>
  30.                             <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 %}">
  31.                                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ 'entity.labels' | trans({}, 'SalesItem') }} <span class="caret"></span></a>
  32.                                 <ul class="dropdown-menu" role="menu">
  33.                                     <li{% if 'app.product.index' == app.request.attributes.get('_route') %} class="active"{% endif %}>
  34.                                         <a href="{{ path('app.product.index') }}">{{ 'ui.products_and_prices' | trans({}, 'Product') }}</a>
  35.                                     </li>
  36.                                     {% if is_granted('ROLE_ADMIN') %}
  37.                                         <li{% if 'app.product_configuration_items' == app.request.attributes.get('_route') %} class="active"{% endif %}>
  38.                                             <a href="{{ path('app.product_configuration_items') }}">{{ 'entity.labels' | trans({}, 'ProductConfigurationItem') }}</a>
  39.                                         </li>
  40.                                     {% endif %}
  41.                                     <li{% if 'app.product.inventory' == app.request.attributes.get('_route') %} class="active"{% endif %}>
  42.                                         <a href="{{ path('app.product.inventory') }}">{{ 'ui.inventory' | trans({}, 'Product') }}</a>
  43.                                     </li>
  44.                                     <li{% if 'app.component_inventory.index' == app.request.attributes.get('_route') %} class="active"{% endif %}>
  45.                                         <a href="{{ path('app.component_inventory.index') }}">{{ 'ui.componentInventory' | trans({}, 'ComponentInventoryItem') }}</a>
  46.                                     </li>
  47.                                     <li role="separator" class="divider"></li>
  48.                                     <li class="dropdown-header">Incomplete Sales Items</li>
  49.                                     <li{% if 'app.sales_item.incomplete.header_platform_type' == app.request.attributes.get('_route') %} class="active"{% endif %}>
  50.                                         <a href="{{ path('app.sales_item.incomplete.header_platform_type') }}">Missing header, platform or type</a>
  51.                                     </li>
  52.                                     <li{% if 'app.sales_item.incomplete.license_info' == app.request.attributes.get('_route') %} class="active"{% endif %}>
  53.                                         <a href="{{ path('app.sales_item.incomplete.license_info') }}">Missing license info</a>
  54.                                     </li>
  55.                                     <li{% if 'app.sales_item.connection_master' == app.request.attributes.get('_route') %} class="active"{% endif %}>
  56.                                         <a href="{{ path('app.sales_item.connection_master') }}">Connection Master Fix</a>
  57.                                     </li>
  58.                                 </ul>
  59.                             </li>
  60.                             <li{% if 'app.company.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
  61.                                 <a href="{{ path('app.company.index') }}">{{ 'ui.customers' | trans({}, 'Company') }}</a>
  62.                             </li>
  63.                             <li{% if 'app.supplier.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
  64.                                 <a href="{{ path('app.supplier.index') }}">{{ 'entity.labels' | trans({}, 'Supplier') }}</a>
  65.                             </li>
  66.                             <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 %}">
  67.                                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ 'entity.labels' | trans({}, 'Setting') }} <span class="caret"></span></a>
  68.                                 <ul class="dropdown-menu" role="menu">
  69.                                     <li{% if 'app.setting.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
  70.                                         <a href="{{ path('app.setting.index') }}">{{ 'entity.labels' | trans({}, 'Setting') }}</a>
  71.                                     </li>
  72.                                     <li{% if 'app.bank_account.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
  73.                                         <a href="{{ path('app.bank_account.index') }}">{{ 'entity.labels' | trans({}, 'BankAccount') }}</a>
  74.                                     </li>
  75.                                     {% if is_granted('ROLE_ADMIN') %}
  76.                                         <li{% if 'app.user.' in app.request.attributes.get('_route') %} class="active"{% endif %}>
  77.                                             <a href="{{ path('app.user.index') }}">{{ 'entity.labels' | trans({}, 'User') }}</a>
  78.                                         </li>
  79.                                     {% endif %}
  80.                                 </ul>
  81.                             </li>
  82.                             <li class="dropdown{% if 'app.report.' in app.request.attributes.get('_route') %} active{% endif %}">
  83.                                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ 'entity.labels' | trans({}, 'Report') }} <span class="caret"></span></a>
  84.                                 <ul class="dropdown-menu" role="menu">
  85.                                     {% for reportClass in get_reports() %}
  86.                                         {% set reportName = constant(reportClass ~ '::NAME') %}
  87.                                         {% if is_granted('read', reportClass) %}
  88.                                             <li><a href="{{ path('app.report.' ~ reportName) }}">{{ ('ui.type.' ~ reportName) | trans({}, 'Report') }}</a></li>
  89.                                         {% endif %}
  90.                                     {% endfor %}
  91.                                 </ul>
  92.                             </li>
  93.                         {% endif %}
  94.                     </ul>
  95.                 {% endif %}
  96.                 <ul class="nav navbar-nav navbar-right">
  97.                     {% if app.user and is_granted('IS_AUTHENTICATED_FULLY') %}
  98.                         {{ render(controller('App\\Controller\\DefaultController::notificationsAlertAction')) }}
  99.                         <li class="dropdown">
  100.                             <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ app.user.name }} <span class="caret"></span></a>
  101.                             <ul class="dropdown-menu" role="menu">
  102.                                 <li><a href="{{ path('nucleos_user_change_password') }}">{{ 'ui.change_password' | trans({}, 'User') }}</a></li>
  103.                                 <li class="divider"></li>
  104.                                 <li><a href="{{ path('nucleos_user_security_logout') }}"><i class="fa fa-sign-out"></i> {{ 'layout.logout' | trans({}, 'NucleosUserBundle') }}</a></li>
  105.                             </ul>
  106.                         </li>
  107.                     {% else %}
  108.                         <li><a href="{{ path('nucleos_user_security_login') }}"><i class="fa fa-sign-in"></i> {{ 'layout.login' | trans({}, 'NucleosUserBundle') }}</a></li>
  109.                     {% endif %}
  110.                 </ul>
  111.             </div>
  112.         </div>
  113.     </nav>
  114.     <div class="container-fluid">
  115.         <div class="row">
  116.             <div class="col-xs-12">
  117.                 {% block breadcrumb_wide %}{% endblock %}
  118.             </div>
  119.         </div>
  120.     </div>
  121.     <div class="container">
  122.         <div class="row">
  123.             <div class="col-xs-12">
  124.                 {% block breadcrumb %}{% endblock %}
  125.                 {% block alerts %}
  126.                     {% for flashMessage in app.session.flashbag.get('success') %}
  127.                         <div class="alert alert-success alert-dismissable">
  128.                             <button data-dismiss="alert" class="close" type="button">×</button>
  129.                             {{ flashMessage | raw }}
  130.                         </div>
  131.                     {% endfor %}
  132.                     {% for flashMessage in app.session.flashbag.get('notice') %}
  133.                         <div class="alert alert-info alert-dismissable">
  134.                             <button data-dismiss="alert" class="close" type="button">×</button>
  135.                             {{ flashMessage | raw }}
  136.                         </div>
  137.                     {% endfor %}
  138.                     {% for flashMessage in app.session.flashbag.get('warning') %}
  139.                         <div class="alert alert-warning alert-dismissable">
  140.                             <button data-dismiss="alert" class="close" type="button">×</button>
  141.                             {{ flashMessage | raw }}
  142.                         </div>
  143.                     {% endfor %}
  144.                     {% for flashMessage in app.session.flashbag.get('error') %}
  145.                         <div class="alert alert-danger alert-dismissable">
  146.                             <button data-dismiss="alert" class="close" type="button">×</button>
  147.                             {{ flashMessage | raw }}
  148.                         </div>
  149.                     {% endfor %}
  150.                 {% endblock alerts %}
  151.             </div>
  152.         </div>
  153.     </div>
  154. {% endblock %}