{#**
 * Copyright since 2021 InPost S.A.
 *
 * NOTICE OF LICENSE
 *
 * Licensed under the EUPL-1.2 or later.
 * You may not use this work except in compliance with the Licence.
 *
 * You may obtain a copy of the Licence at:
 * https://joinup.ec.europa.eu/software/page/eupl
 * It is also bundled with this package in the file LICENSE.txt
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the Licence is distributed on an AS IS basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the Licence for the specific language governing permissions
 * and limitations under the Licence.
 *
 * @author    InPost S.A.
 * @copyright Since 2021 InPost S.A.
 * @license   https://joinup.ec.europa.eu/software/page/eupl
 *#}
{# @PrestaShop/Admin/Component/LegacyLayout/toolbar.html.twig with a modified nav tab rendering logic #}
<div class="bootstrap">
  <div class="page-head with-tabs">
    <div class="wrapper clearfix">
      {% block pageBreadcrumb %}
        <ul class="breadcrumb page-breadcrumb">
          {# Container #}
          {% if this.breadcrumbs.container is defined and this.breadcrumbs.container.name != '' %}
            <li class="breadcrumb-container">
              {% if this.breadcrumbs.container.icon is not empty %}<i class="material-icons">{{ this.breadcrumbs.container.icon }}</i>{% endif %}
              {{ this.breadcrumbs.container.name|escape }}
            </li>
          {% endif %}

          {# Current Tab #}
          {% if this.breadcrumbs.tab is defined and this.breadcrumbs.tab.name != '' %}
            <li class="breadcrumb-current">
              {% if this.breadcrumbs.tab.icon is not empty %}<i class="material-icons">{{ this.breadcrumbs.tab.icon }}</i>{% endif %}
              {% if this.breadcrumbs.tab.href != '' %}<a href="{{ this.breadcrumbs.tab.href|escape }}">{% endif %}
                {{ this.breadcrumbs.tab.name|escape }}
                {% if this.breadcrumbs.tab.href != '' %}</a>{% endif %}
            </li>
          {% endif %}
        </ul>
      {% endblock %}

      {% block pageTitle %}
        <h1 class="page-title">
          {% if this.layoutHeaderToolbarBtn.back is defined %}
            {% set backButton = this.layoutHeaderToolbarBtn.back %}
            <a id="page-header-desc-{{ this.table }}{% if backButton.imgclass is defined %}-{{ backButton.imgclass }}{% endif %}"
               class="page-header-toolbar-back{% if backButton.target is defined and backButton.target is not empty %} _blank{% endif %}"
               {% if backButton.href is defined %}href="{{ backButton.href|escape }}"{% endif %}
               title="{{ backButton.desc }}"{% if backButton.js is defined and backButton.js is not empty %} onclick="{{ backButton.js }}"{% endif %}>
            </a>
          {% endif %}
          {{ this.title|e }}
        </h1>
      {% endblock %}

      {% block toolbarBox %}
        <div class="page-bar toolbarBox">
          <div class="btn-toolbar">
            <a href="#" class="toolbar_btn dropdown-toolbar navbar-toggle" data-toggle="collapse"
               data-target="#toolbar-nav"><i class="process-icon-dropdown"></i>
              <div>{{ 'Menu'|trans({}, 'Admin.Navigation.Menu') }}</div>
            </a>
            <ul id="toolbar-nav" class="nav nav-pills pull-right collapse navbar-collapse">
              {{ renderhook('displayDashboardToolbarTopMenu') }}
              {% for k, btn in this.layoutHeaderToolbarBtn %}
                {% if k != 'back' and k != 'modules-list' %}
                  <li>
                    <a
                        id="page-header-desc-{{ this.table }}-{% if btn.imgclass is defined %}{{ btn.imgclass|escape }}{% else %}{{ k }}{% endif %}"
                        class="toolbar_btn{% if btn.target is defined and btn.target %} _blank{% endif %} pointer"
                        {% if btn.href is defined %}
                          href="{{ btn.href|escape }}"
                        {% endif %}
                        title="{% if btn.help is defined %}{{ btn.help }}{% else %}{{ btn.desc|escape }}{% endif %}"
                        {% if btn.modal_target is defined and btn.modal_target %}
                          data-target="{{ btn.modal_target }}"
                          data-toggle="modal"
                        {% endif %}
                        {% if btn.help is defined %}
                          data-toggle="pstooltip"
                          data-placement="bottom"
                        {% endif %}
                        data-role="page-header-desc-{{ this.table }}-link"
                    >
                      <i class="{% if btn.icon is defined and btn.icon is not empty %}{{ btn.icon|escape }}{% else %}process-icon-{% if btn.imgclass is defined %}{{ btn.imgclass|escape }}{% else %}{{ k }}{% endif %}{% endif %}{% if btn.class is defined %} {{ btn.class|escape }}{% endif %}"></i>
                      <div{% if btn.force_desc is defined and btn.force_desc == true %} class="locked"{% endif %}>
                        {{ btn.desc|escape }}
                      </div>
                    </a>
                  </li>
                {% endif %}
              {% endfor %}

              <li>
                <a class="toolbar_btn btn-help" href="{{ this.helpLink }}" title="{{ 'Help'|trans({}, 'Admin.Global') }}">
                  <div>{{ 'Help'|trans({}, 'Admin.Global') }}</div>
                </a>
              </li>
            </ul>
          </div>
        </div>
      {% endblock %}
      {% block pageSubTitle %}
        {% if this.subTitle is not empty %}
          <h4 class="page-subtitle">
            {{ this.subTitle }}
          </h4>
        {% endif %}
      {% endblock %}
    </div>

    <div class="page-head-tabs" id="head_tabs">
      {{ inpost_shipping_nav_tabs|raw }}
    </div>
  </div>
  {{ renderhook('displayDashboardTop') }}
</div>
