{#
 # For the full copyright and license information, please view the
 # docs/licenses/LICENSE.txt file that was distributed with this source code.
 #}
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7 lt-ie6"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8 ie7"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9 ie8"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js ie9"> <![endif]-->
<html lang="{{ ps.isoUser }}">
<head>
  {% block header %}
    {{ component('LegacyHeadTag', {metaTitle: metaTitle|default}) }}
  {% endblock %}
</head>

<body class="lang-{{ ps.isoUser }}{% if ps.isRtlLanguage %} lang-rtl{% endif %} ps_back-office page-sidebar {{ ps.controllerName|escape|lower }}{% if ps.menuCollapsed %} page-sidebar-closed{% endif %}{% if ps.multiShop|default(false) %} multishop-enabled{% endif %}{% if ps.debugMode|default(false) %} developer-mode{% endif %} ps-bo-rebrand"
  {% if ps.jsRouterMetadata is defined and ps.jsRouterMetadata.base_url is defined %}data-base-url="{{ ps.jsRouterMetadata.base_url }}"{% endif %}
  {% if ps.jsRouterMetadata is defined and ps.jsRouterMetadata.token is defined %}data-token="{{ ps.jsRouterMetadata.token }}"{% endif %}
>

{# Layout header #}
{% block layout_header %}
  <header id="header" class="bootstrap">
    <nav id="header_infos" role="navigation">
      <i class="material-icons js-mobile-menu">menu</i>

      {# Logo #}
      <a id="header_logo" href="{{ ps.defaultTabLink }}" aria-label="{{ 'PrestaShop logo'|trans({}, 'Admin.Navigation.Header') }}"></a>
      <span id="shop_version">{{ ps.version }}</span>

      {{ component('LegacyQuickAccess') }}
      {{ component('LegacySearchForm') }}

      {% if ps.debugMode|default(false) %}
        <div class="component hide-mobile-sm">
          <a class="shop-state label-tooltip"
             id="debug-mode"
             data-toggle="tooltip"
             data-placement="bottom"
             data-html="true"
             title="<p class=&quot;text-left&quot;><strong>{{ 'Your shop is in debug mode.'|trans({}, 'Admin.Navigation.Notification') }}</strong></p><p class=&quot;text-left&quot;>{{ 'All the PHP errors and messages are displayed. When you no longer need it, [1]turn off[/1] this mode.'|trans({'[1]': '<strong>', '[/1]': '</strong>'}, 'Admin.Navigation.Notification') }}</p>"
             href="{{ url('admin_performance') }}"
          >
            <i class="material-icons">bug_report</i>
            <span>{{ 'Debug mode'|trans({}, 'Admin.Navigation.Header') }}</span>
          </a>
        </div>
      {% endif %}
      {% if ps.isMaintenanceEnabled|default(false) %}
        {% set maintenanceTitle %}
          <p class="text-left">
            <strong>
              {{ 'Your store is in maintenance mode.'|trans({}, 'Admin.Navigation.Notification') }}
            </strong>
          </p>
          <p class="text-left">
            {{ 'Your visitors and customers cannot access your store while in maintenance mode.'|trans({}, 'Admin.Navigation.Notification') }}
          </p>
          <p class="text-left">
            {{ 'To manage the maintenance settings, go to Shop Parameters > Maintenance tab.'|trans({}, 'Admin.Navigation.Notification') }}
          </p>
          {% if ps.frontOfficeAccessibleForAdmins|default(false) %}
            <p class="text-left">
              {{ 'Admins can access the store front office without storing their IP.'|trans({}, 'Admin.Navigation.Notification') }}
            </p>
          {% endif %}
        {% endset %}
        <div class="component hide-mobile-sm">
          <a class="shop-state label-tooltip"
             id="maintenance-mode"
             data-toggle="tooltip"
             data-placement="bottom"
             data-html="true"
             title="{{ maintenanceTitle|e('html') }}"
             href="{{ url('admin_maintenance') }}"
          >
            <i class="material-icons">build</i>
            <span>{{ 'Maintenance mode'|trans({}, 'Admin.Navigation.Header') }}</span>
          </a>
        </div>
      {% endif %}

      {{ component('LegacyShopList') }}

      {{ component('LegacyNotificationsCenter') }}
      {{ component('LegacyEmployeeDropdown') }}

      {# Ajax running * #}
      <span id="ajax_running" class="hidden-xs">
        <i class="icon-refresh icon-spin icon-fw"></i>
      </span>

      {{ renderhook('displayBackOfficeTop') }}
    </nav>
  </header>

  {{ component('LegacyNavBar') }}
{% endblock %}

  <div id="main">
    <div id="content" class="bootstrap{% if ps.displayedWithTabs %} with-tabs{% endif %}">
      {# Page header toolbar #}
      {% if showContentHeader %}
        {{ component('LegacyToolbar', {
          layoutTitle: layoutTitle|default,
          layoutSubTitle: layoutSubTitle|default,
          helpLink: help_link|default,
          enableSidebar: enableSidebar|default(false),
          layoutHeaderToolbarBtn: layoutHeaderToolbarBtn|default([]),
          breadcrumbLinks: breadcrumbLinks|default([]),
        }) }}
      {% endif %}

      {% block content_header %}
        {% block session_alert %}
          {{ component('LegacySessionAlert') }}
        {% endblock %}
      {% endblock %}

      {% block content %}
        {{ legacyContent|raw }}
      {% endblock %}
    </div>
  </div>

  <div id="footer" class="bootstrap">
    <div class="col-sm-12">
      {{ renderhook('displayBackOfficeFooter', {}) }}
    </div>
  </div>

  {% if modals is defined and modals is not empty %}
    <div class="bootstrap">
      {{ modals|raw }}
    </div>
  {% endif %}
</body>
</html>
