<!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 %}| {{ head }}{% else %}{% block title %}{% endblock %}{% endif%}
		</title>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="description" content="">
		<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">
				<p>Created by the <a href="http://www.ucl.ac.uk/excites">ExCiteS Research Group</a> &bull; <a href="https://groups.google.com/d/forum/opencommunitymaps">Join our mailing list</a> &bull; <a href="https://github.com/ExCiteS/opencommunitymaps">Contribute on Github</a></p>
			</div>
		</footer>

		{% if not user.is_anonymous %}
			<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script>
			<script>window.jQuery || document.write('<script src="/static/lib/jquery/jquery-1.10.1.js"><\/script>');</script>
			<script src="/static/lib/bootstrap/js/bootstrap.min.js"></script>
		{% endif %}
		{% if not error %}
			{% block modals %} {% endblock %}
			{% block libraries %} {% endblock %}
		{% endif %}
	</body>
</html>
