<!DOCTYPE html>

<!--[if IE 7]><html lang="en" class="no-js lt-ie9 lt-ie8"><![endif]-->
<!--[if IE 8]><html lang="en" class="no-js lt-ie9"><![endif]-->
<!--[if gt IE 8]><html lang="en" class="no-js"><![endif]-->
    <head>
        <title>{{ PLATFORM_NAME }} {% if error %}| {{ error }}{% else %}{% block title %}{% endblock %}{% endif%}</title>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width">
        <meta name="description" content="Platform for participatory mapping, developed by ExCiteS at University College London." />

        <link rel="stylesheet" href="/static/lib/bootstrap/css/bootstrap.min.css">
        <link rel="stylesheet" href="/static/css/admin.css">

        <script src="/static/lib/modernizr/modernizr-2.6.2-respond-1.1.0.min.js"></script>
    </head>

    <body id="base" {% block bodydata %}{% endblock %}>
        <div class="navbar navbar-default navbar-fixed-top">
            <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 menu navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>

                    <a class="navbar-brand" href="/admin/">{{ PLATFORM_NAME }}</a>
                </div>


                <nav class="navbar-collapse collapse">
                    <ul class="nav navbar-nav navbar-right">
                        <li>
                            <a href="http://geokey.org.uk/help/">
                                <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
                                <span>Help</span>
                            </a>
                        </li>

                        {% if not user.is_anonymous %}
                            <li>
                                <a href="{% url 'admin:dashboard'%}">
                                    <span class="glyphicon glyphicon-th" aria-hidden="true"></span>
                                    <span>Dashboard</span>
                                </a>
                            </li>

                            <li>
                                <a href="{% url 'admin:userprofile'%}">
                                    <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
                                    <span>{{ user.display_name }}</span>
                                </a>
                            </li>

                            <li>
                                <a href="/admin/account/logout/">
                                    <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
                                    <span>Sign out</span>
                                </a>
                            </li>
                        {% endif %}
                    </ul>
                </nav>
            </div>
        </div>

        <main id="content">
            {% if error %}
                {% include 'snippets/error.html' %}
            {% else %}
                {% block main %}{% endblock %}
            {% endif %}
        </main>

        {% include 'snippets/footer.html' %}

        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="/static/lib/jquery/jquery-1.12.0.min.js"><\/script>');</script>
        <script src="/static/lib/bootstrap/js/bootstrap.min.js"></script>

        {% include 'snippets/google_analytics.html' %}

        {% if not error %}
            {% block modals %}{% endblock %}
            {% block libraries %}{% endblock %}
        {% endif %}
    </body>
</html>
