<!DOCTYPE html>
{% import 'admin/layout.html' as layout with context -%}
{% import 'admin/static.html' as admin_static with context %}
{% import "oy/contrib/admin/form_fields_macros.html" as form_field_macros with context %}

<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
  <title>{% block title %}{% if admin_view.category %}{{ admin_view.category }} - {% endif %}{{ admin_view.name }} - {{ admin_view.admin.name }}{% endblock %}</title>
  {% block head_meta %}
  {% endblock %}
  {% block head_css %}
  <!-- Bootstrap -->
    <link href="{{ admin_static.url(filename='bootstrap/bootstrap3/swatch/{swatch}/bootstrap.min.css'.format(swatch=config.get('FLASK_ADMIN_SWATCH', 'default')), v='3.3.5') }}" rel="stylesheet">
    <link href="{{ admin_static.url(filename='bootstrap/bootstrap3/css/bootstrap-theme.min.css', v='3.3.5') }}" rel="stylesheet">
  <!-- Font Awesome -->
  <link href="{{ admin_plugin_static('vendor/css/font-awesome.min.css') }}" rel="stylesheet">
  <link href="{{ admin_plugin_static('vendor/css/lity.min.css') }}" rel="stylesheet">
  <link href="{{ admin_plugin_static('vendor/css/animate.min.css') }}" rel="stylesheet">
  <link href="{{ admin_plugin_static('css/custom.min.css') }}" rel="stylesheet">
  <!-- Custom Admin Style -->
  <link href="{{ admin_static.url(filename='admin/css/bootstrap3/admin.css', v='1.1.1') }}" rel="stylesheet">

    {% if admin_view.extra_css %}
      {% for css_url in admin_view.extra_css %}
      <link href="{{ css_url }}" rel="stylesheet">
      {% endfor %}
    {% endif %}
	{{ form_field_macros.render_form_css() }}
  {% endblock %}
  {% block head %}
  {% endblock %}
  {% block head_tail %}
  {% endblock %}
  </head>
  <body class="nav-md">

  <!-- Page Content Starts Here -->
  {% block page_body %}
  <div class="container body">
    <div class="main_container">

    <div class="col-md-3 left_col" id="side-navigation">
      <div class="left_col scroll-view">
      <div class="navbar nav_title" style="border: 0;">
        {% block brand %}
        <a class="site_title" href="{{ admin_view.admin.url }}">{{ admin_view.admin.name }}</a>
        {% endblock %}
      </div>

      <div class="clearfix"></div>

      <br />

      <!-- sidebar menu -->
      {% block main_menu %}
      <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
        <div class="menu_section">
        <h3>Main Menu</h3>
        <ul class="nav side-menu">
        {{ layout.menu() }}
        </ul>
        </div>
      </div>
      {% endblock %}
      <!-- /sidebar menu -->

      </div>
    </div>

    <!-- top navigation -->
    {% block menu_links %}
    <div class="top_nav pull-right" id="menu-links">
      <div class="nav_menu">
      <nav>
        <div class="nav toggle" id="side-menu-toggler">
        <a role="button" id="menu_toggle" title="{{ gettext("Expand menu") }}"><i class="fa fa-expand"></i></a>
        </div>
        <ul class="nav navbar-nav navbar-right">
        {{ layout.menu_links() }}
        </ul>
      </nav>
      {% block access_control %}
      {% endblock %}
      </div>
    </div>
    {% endblock %}
    <!-- /top navigation -->

    <!-- page content -->
    <div class="right_col" role="main">
    {% block messages %}
    {{ layout.messages() }}
    {% endblock %}

    {# store the jinja2 context for form_rules rendering logic #}
    {% set render_ctx = h.resolve_ctx() %}
    {% block page_header %}
    <div class="page-title">
      <div class="title_left">
      <h1 class="page-title">{{admin_view.name|capitalize}}</h1>
      </div>
    </div>
    {% endblock %}

    <div class="clearfix"></div>

    {% block body %}{% endblock %}
    </div>
    <!-- /page content -->

    <!-- footer content -->
    <footer>
      <div class="pull-right">
      Oy Content Management System
      </div>
      <div class="clearfix"></div>
    </footer>
    <!-- /footer content -->

    </div>
  </div>

  {% endblock %}
  <!-- Page Content Ends Here -->

  {% block tail_js %}
  <script src="{{ admin_plugin_static('vendor/js/jquery.min.js') }} " type="text/javascript"></script>
  <script src="{{ admin_plugin_static('vendor/js/lity.min.js') }} " type="text/javascript"></script>
      <script src="{{ admin_static.url(filename='bootstrap/bootstrap3/js/bootstrap.min.js', v='3.3.5') }}" type="text/javascript"></script>
  <script src="{{ admin_plugin_static('js/custom.min.js') }}" type="text/javascript"></script>
  <script src="{{ admin_plugin_static('js/admin-extra.js') }}" type="text/javascript"></script>
  <script src="{{ admin_static.url(filename='vendor/moment.min.js', v='2.9.0') }}" type="text/javascript"></script>
  <script src="{{ admin_static.url(filename='vendor/select2/select2.min.js', v='3.5.2') }}" type="text/javascript"></script>

  {% if admin_view.extra_js %}
    {% for js_url in admin_view.extra_js %}
    <script src="{{ js_url }}" type="text/javascript"></script>
    {% endfor %}
  {% endif %}

  {{ form_field_macros.render_form_js() }}

  {% endblock %}

  {% block tail %}
  {% endblock %}
  </body>
</html>