{#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#}

{% import 'admin/layout.html' as layout with context -%}
{% import 'admin-ng/layout.html' as layout_overwrite with context -%}
{%- extends "page.html" -%}

{%- block css -%}{% block head_css %}<link href="{{ url_for('admin.static', filename='css/admin.css') }}" rel="stylesheet">{% endblock %}{%- endblock css -%}
{%- bundle "admin.js" %}

{% block global_bundles %}
  {{ super() }}
  {% bundles "admin.css" %}
{% endblock %}

{% block header %}
  {%- include "base/scripts.html" %}
  {{ super() }}
  {% block head_meta %}{% endblock -%}
  {% block head_tail %}{% endblock -%}
{%- endblock header %}
{%- block _bottom_assets %}
  {# The legacy page requires that the scripts are loaded from the <head>
   # rather than at the bottom of the page.
   #}
{%- endblock %}

{%- block page_header -%}
  <div class="wrapper {{ config.get("ADMIN_UI_SKIN") }}" data-sidebar="sidebar-collapse">
    {% include 'admin_header.html' %}
{%- endblock page_header -%}

{% block page_body %}
  <aside class="main-sidebar">
    <section class="sidebar">
      <ul class="sidebar-menu">
        {{ layout_overwrite.menu_overwrite() }}
      </ul>
    </section>
  </aside>
  <div class="content-wrapper">
    {% if admin_view.name %}
      <section class="content-header">
        {{ layout.messages() }}
        <h4>{{admin_view.name}}</h4>
      </section>
    {% endif %}
    <section class="content">
      {% block body %}{% endblock %}
    </section>
  </div>
  {%- include 'admin_footer.html' -%}
{% endblock %}

{%- block page_footer %}{%- endblock page_footer %}
