<!DOCTYPE html>

<!--[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>
		<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">

		<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{% block bodydata %} {% endblock %}>
		<div class="navbar navbar-default navbar-fixed-top">
			<div class="container">
				<div class="navbar-header">
					{% if not user.is_anonymous %}
    					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
    						<span class="icon-bar"></span>
    						<span class="icon-bar"></span>
    						<span class="icon-bar"></span>
    					</button>
					{% endif %}

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

				{% if not user.is_anonymous %}
    				<div class="navbar-collapse collapse">
    					<ul class="nav navbar-nav navbar-right">
    						<li><a href="/admin/"><span class="glyphicon glyphicon-th"></span> Dashboard</a></li>
    						<li><a href="{% url 'admin:userprofile'%}"><span class="glyphicon glyphicon-user"></span> {{ user.display_name }}</a></li>
    						<li><a href="/admin/account/logout/"><span class="glyphicon glyphicon-off"></span> Sign out</a></li>
    					</ul>
    				</div>
				{% endif %}
			</div>
		</div>

		{% if error %}
			{% include 'snippets/error.html' %}
		{% else %}
			{% block main %} {% endblock %}
		{% endif %}

		<footer>
			<div class="container">
				<div class="row">
					<div class="col-sm-4">
						<p>GeoKey {{ GEOKEY_VERSION }}</p>
						<p>Created by <a href="http://www.ucl.ac.uk/excites">ExCiteS research group</a>
					</div>

					<div class="col-sm-4">
						<p><a href="http://geokey.org.uk/help/">Help</a></p>
						<p><a href="http://geokey.org.uk/docs/web-api.html">API documentation</a></p>
					</div>

					<div class="col-sm-4">
						<p><a href="https://twitter.com/geokey_project">Follow GeoKey on Twitter</a></p>
						<p><a href="https://github.com/excites/geokey/">Contribute on Github</a></p>
					</div>
				</div>
			</div>
		</footer>

		<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>
