<!doctype html>
<html lang="en" class="no-js">
<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/events.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">
        <a class="brand" href="{{ url_for('admin.index') }}">Site Admin</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 class="pull-right" action="{{ url_for('auth.logout') }}" method="get">
          <button class="btn primary">Logout</button>
        </form>
      </div>
    </div>
  </div>

  <div class="container">
    <div class="content">
      {% 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 %}
      <div class="page-header">
        <h1>{% block content_title %}{% endblock %} <small>{% block content_tagline %}{% endblock %}</small></h1>
      </div>
      <div class="row">
        <div class="span12 main">
          {% block content %}{% endblock %}
        </div>
        <div class="span4 sidebar">
          <h3>Models</h3>
          {% block sidebar %}
            <ul>
              {% 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>
                  {% if model_admin == iter_admin %}
                    <ul>
                      <li><a href="{{ url_for(iter_admin.get_url_name('add')) }}">Add new</a></li>
                    </ul>
                  {% endif %}
                </li>
              {% endfor %}
            </ul>
          {% endblock %}
        </div>
      </div><!-- /row -->
    </div><!-- /content -->

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