<!DOCTYPE html>{% load static %}
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Le Hachoir - {% block title %}{% if title %}{{ title }}{% else %}No Title{% endif %}{% endblock %}</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
        <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

        <style>
            body {
                padding-top: 50px;
                padding-bottom: 20px;
            }
        </style>
        <link rel="stylesheet" href="{% static 'css/main.css' %}">

        {% block head %}{% endblock %}
        <style>{% block extra_css %}{% endblock %}</style>
    </head>
    <body>
        <!--[if lt IE 7]>
            <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->
        {% if user.is_authenticated %}
        <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="/">djhcup-hachoir</a>
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        {% if "djhcup_reporting" in djhcup_components %}<li><a href="{% url 'datasets_browse' %}">Datasets</a></li>{% endif %}
                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                {{ user.email }} <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li><a href="{% url 'logout' %}">Logout</a></li>
                            </ul>
                        </li>
                    </ul>
                </div><!--/.navbar-collapse -->
            </div>
        </div>
        {% endif %}

        <div class="container">
            {% block header %}
            {% if title %}
            <div class="page-header">
                <h1>{{ title }}</h1>
            </div>
            {% endif %}
            {% endblock %}

            {% block messages %}
            {% for m in messages %}
            <div class="alert alert-{{ m.tags }}">
                {{ m.message|safe }}
            </div>
            {% endfor %}
            {% endblock %}

            {% block content %}{% endblock %}

            <hr>

            <footer>
            {% block footer %}
            <p>&copy; Company 2014</p>
            {% endblock %}
            </footer>
        </div> <!-- /container -->
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
        <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
        <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
        <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.js"></script>

        {% block body_js %}{% endblock %}

    </body>
</html>
