<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">

  <!--[if IE]><![endif]-->

  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <title>{% block title %}{% endblock %}{% block title_branding %} | {{ branding }}{% endblock %}</title>
  <meta name="description" content="">
  <meta name="author" content="">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <link rel="stylesheet" href="{{ url_for('admin.static', filename='css/bootstrap.min.css') }}">
  <link rel="stylesheet" href="{{ url_for('admin.static', filename='css/bootstrap.min.responsive.css') }}">
  <link rel="stylesheet" href="{{ url_for('admin.static', filename='css/chosen.css') }}">
  <link rel="stylesheet" href="{{ url_for('admin.static', filename='css/datepicker.css') }}">
  <link rel="stylesheet" href="{{ url_for('admin.static', filename='css/admin.css') }}">

  <script src="{{ url_for('admin.static', filename='js/jquery.min.js') }}"></script>
  <script src="{{ url_for('admin.static', filename='js/bootstrap.min.js') }}"></script>
  <script src="{{ url_for('admin.static', filename='js/bootstrap-datepicker.js') }}"></script>
  <script src="{{ url_for('admin.static', filename='js/chosen.jquery.min.js') }}"></script>
  <script src="{{ url_for('admin.static', filename='js/ajax-chosen.min.js') }}"></script>
  <script src="{{ url_for('admin.static', filename='js/admin.js') }}"></script>

  {% block extra_script %}{% endblock %}
</head>

<body class="{% block body_class %}admin{% endblock %}">
  <div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
      <div class="container-fluid">
        <a class="brand" href="{{ url_for('admin.index') }}">{{ branding }}</a>
        <ul class="nav">
          <li class="active"><a href="{{ url_for('admin.index') }}">Dashboard</a></li>
          <li><a href="/">View site</a></li>
        </ul>

        <form action="{{ url_for('auth.logout') }}" class="navbar-form pull-right" method="get">
          <button class="btn btn-danger">Logout</button>
        </form>
      </div>
    </div>
  </div>

  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span3">
        <div class="well sidebar-nav">
          <h3>Navigation</h3>
          {% block sidebar %}
            <ul id="nav" class="nav nav-list">
              {% for iter_admin in model_admins %}
                <li{% if model_admin == iter_admin %} class="active"{% endif %}><a href="{{ url_for(iter_admin.get_url_name('index')) }}">{{ iter_admin.get_admin_name()|fix_underscores }}</a></li>
              {% endfor %}
            </ul>
          {% endblock %}
        </div>
      </div><!-- /sidebar -->

      <div class="span9">
        <div class="content">
          <div class="page-header">
            <h1>{% block content_title %}{% endblock %} <small>{% block content_tagline %}{% endblock %}</small></h1>
          </div>
          <ul class="breadcrumb">
            <li><a href="{{ url_for('admin.index') }}">Dashboard</a></li>
            {% block breadcrumbs %}{% endblock %}
          </ul>
          {% for category, message in get_flashed_messages(with_categories=true) %}
            <div class="alert alert-block alert-{{ category }}">
              <a class="close" data-dismiss="alert" href="#">×</a>
              <p>{{ message }}</p>
            </div>
          {% endfor %}
          {% block pre_content %}{% endblock %}
          {% block content %}{% endblock %}
        </div><!-- /content -->
      </div><!-- /row -->
      <hr />
      <footer>
        <p>{% block footer %}Site administration{% endblock %}</p>
      </footer>
  </div> <!-- /container-fluid -->
</body>
</html>
