<!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 %} | Admin</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/admin.css') }}">
 
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  <script>!window.jQuery && document.write('<script src="{{ url_for('admin.static', filename='js/jquery.min.js') }}"><\/script>')</script>
  <script src="{{ url_for('admin.static', filename='js/bootstrap-alerts.js') }}"></script>
  <script src="{{ url_for('admin.static', filename='js/bootstrap-dropdown.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="topbar">
    <div class="fill">
      <div class="container-fluid">
        <h3><a class="brand" href="{{ url_for('admin.index') }}">Site Admin <small>flask-peewee</small></a></h3>

        <ul class="nav secondary-nav">
          <li class="active"><a href="{{ url_for('admin.index') }}">Dashboard</a></li>
          <li><a href="/">View site</a></li>
          <li>
            <form action="{{ url_for('auth.logout') }}" method="get">
              <button class="btn danger">Logout</button>
            </form>
          </li>
        </ul>
      </div>
    </div>
  </div>

  <div class="container-fluid">
    <div class="sidebar">
      <div class="well">
      <h3>Navigation</h3>
      {% block sidebar %}
        <ul id="nav" class="navigation">
          {% 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="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-message {{ category }}">
          <a class="close" href="#">×</a>
          <p>{{ message }}</p>
        </div>
      {% endfor %}
      {% block pre_content %}{% endblock %}
      {% block content %}{% endblock %}
    </div><!-- /content -->

    <footer>
      <p>{% block footer %}Site administration{% endblock %}</p>
    </footer>
  </div> <!-- /container-fluid -->
</body>
</html>
