= admin_inject_currency_config
= render "layouts/i18n_script"
= yield :stripe_js

#wrapper
  #flashes
    = render partial: "admin/shared/flashes", locals: { flashes: flash }

  = render partial: "spree/layouts/admin/progress_spinner"

  %header#header
    .container
      %figure.columns.five
        = link_to image_tag(Spree::Config[:admin_interface_logo], :id => 'logo'), spree.admin_dashboard_path
      %nav.columns.eleven.admin-login-navigation-bar
        = render :partial => 'spree/layouts/admin/login_nav'

  %nav#admin-menu
    .container.no-gutter
      .sixteen.columns.main-menu-wrapper
        %ul.inline-menu
          = render :partial => 'spree/admin/shared/tabs'

  - if content_for?(:sub_menu)
    %nav#sub-menu
      .container
        .sixteen.columns
          = yield :sub_menu

  - if content_for?(:page_title) || content_for?(:page_actions)
    .js-admin-section-header.admin__section-header
      .container
        .sixteen.columns
          .admin__section-header__content
            - if content_for?(:page_title)
              .admin__section-header__title
                %h1.js-admin-page-title= yield :page_title

            - if content_for?(:page_actions)
              %ul.admin__section-header__actions
                = yield :page_actions

  - content_class = content_for?(:sidebar) ? "with-sidebar" : ""
  - usefull_width_columns = content_for?(:sidebar) ? "twelve columns" : "sixteen columns"
  #content{class: content_class}
    .container
      .row
        - if content_for?(:table_filter)
          #table-filter{:class => usefull_width_columns}
            %fieldset
              %legend{:align => "center"}= yield :table_filter_title
              = yield :table_filter
        %div{:class => usefull_width_columns}
          = yield
        - if content_for?(:sidebar)
          %aside#sidebar.four.columns
            - if content_for?(:sidebar_title)
              %h5.sidebar-title
                %span= yield :sidebar_title
            = yield :sidebar

  = render "admin/terms_of_service_banner" if tos_need_accepting?
    
%script
  = raw "Spree.api_key = \"#{spree_current_user.try(:spree_api_key).to_s}\";"

= render "layouts/matomo_tag"

= yield :admin_footer
