<!DOCTYPE html>
<html>
  <head>
    <title>{% block title %}{{ handler.settings['site_title'] }}{% endblock %}</title>
    <meta name="description" content="{{ handler.settings['site_title'] }}"/>
    <meta name="version" content="{{ version }}"/>
    <link rel="stylesheet" type="text/css" media="all" href="{{ static }}vendor/bootstrap/css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" media="all" href="{{ static }}css/tablesorter.bootstrap.css"/>
    <link rel="stylesheet" type="text/css" media="all" href="{{ static }}css/metric.css"/>
    <link rel="stylesheet" type="text/css" media="all" href="{{ static }}css/main.css"/>
    <link rel="stylesheet" type="text/css" media="all" href="{{ static }}css/nv.d3.css"/>
    <link rel="stylesheet" type="text/css" media="all" href="{{ static }}vendor/select2/select2.css" />

    <script type="text/javascript" src="{{ static }}js/underscore-min.js"></script>
    <script type="text/javascript" src="{{ static }}js/jquery.js"></script>
    <script type="text/javascript" src="{{ static }}vendor/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript" src="{{ static }}js/d3.v2.js"></script>
    <script type="text/javascript" src="{{ static }}js/nv.d3.js"></script>
    <script type="text/javascript" src="{{ static }}js/swig.pack.min.js"></script>
    <script type="text/javascript" src="{{ static }}js/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="{{ static }}js/locales/bootstrap-datepicker.ru.js"></script>
    <script type="text/javascript" src="{{ static }}vendor/select2/select2.min.js"></script>
    <script type="text/javascript" src="{{ static }}js/jquery.tablesorter.js"></script>
    <script type="text/javascript" src="{{ static }}js/jquery.tablesorter.widgets.js"></script>
    <script type="text/javascript" src="{{ static }}vendor/moment.min.js"></script>
    <script type="text/javascript" src="{{ static }}vendor/moment-range.js"></script>
    <script type="text/javascript" src="{{ static }}js/main.js"></script>
    <script></script>
    {% block head %}{% endblock %}
  </head>
  <body>
    {% block header %}
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="{{ reverse('home') }}">{{ handler.settings['site_title'] }}</a>
          <div class="pull-left">
            <ul class="nav secondary-nav project-dropdown">
              <li class="dropdown js-project-dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="">
                  <span class="js-current-project">Projects</span>
                  <b class="caret"></b>
                </a>
                <ul class="dropdown-menu pull-right" id="project-selector">
		  {% for project in projects -%}
		  <li><a href="#project" title="{{ project }}" data-name="{{ project }}" class="js-project-link active">{{ project }}</a></li>
		  {%- endfor %}
                </ul>
              </li>
            </ul>
          </div>
	  <ul class="nav pull-right">
	    {% if user %}
	    <ul class="nav secondary-nav">
              <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="">
                  <span>{{ user['first_name']}} {{ user['last_name'] }}</span>
                  <b class="caret"></b>
                </a>
                <ul class="dropdown-menu pull-right">
		  <li><a href="{{ reverse('logout') }}">Logout</a></li>
                </ul>
              </li>
            </ul>
	    {% else %}
	    <li><a href="{{ reverse('login') }}">Login</a></li>
	    {% endif %}
          </ul>
        </div>
      </div>
    </div>
    {% endblock %}
    <div id="controls" class="navbar container">
      <div class="navbar-inner">
	{% block control %}<h1>Not implemented error</h1>{% endblock %}
      </div>
    </div>
    <div class="container charts-container">
    {% block charts %}<h1>Not implemented error</h1>{% endblock %}
    {% block footer %}<footer><p>©</p></footer>{% endblock %}
    </div>
</body>
</html>
