{% load url from future %}
{% load i18n %}{% load cms %}
{% spaceless %}
<!doctype html>
{# paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ #}
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}><![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8" lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}><![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9" lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}><![endif]-->
<!--[if gt IE 8]><!--><html class="no-js" lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}><!--<![endif]-->
	<head>
		<meta charset="utf-8" />

		{# Use the .htaccess and remove these lines to avoid edge case issues. More info: h5bp.com/b/378 #}
  		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

		{# Prefetch your CDN URL: http://j.mp/bplatednsfetch #}
		<link rel="dns-prefetch" href="{{ STATIC_URL }}scarlet/" />

		{# Set STATIC_URL parameter #}
		<link rel="static-url" href="{{ STATIC_URL }}scarlet/" />

		<title>{% block title %}{{ title }}{% endblock title %}</title>

		<meta name="description" content="{% block meta_description %}{{ page.description }}{% endblock %}" />
		<meta name="keywords" content="{% block meta_keywords %}{{ page.keywords }}{% endblock %}" />
		<meta name="author" content="RED Interactive Agency" />

		{# Mobile viewport optimized: j.mp/bplateviewport #}
		<meta name="viewport" content="width=1024" />

		{# Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons #}

		{# CSS: implied media="all" #}
		<link rel="stylesheet" id="caboose" href="{{ STATIC_URL }}scarlet/css/admin.css" />

		{# All JavaScript at the bottom, except for Modernizr. #}
		{# Modernizr enables HTML5 elements & feature detects; For optimal performance, use a custom Modernizr build: www.modernizr.com/download/ #}
		<script src="{{ STATIC_URL }}scarlet/js/libs/modernizr.js"></script>
		{% block extrastyle %}{% endblock %}
		{% block extrahead %}{% endblock %}
	</head>
	<body class="{% block page_class %}page{% endblock page_class %}">
		<div id="container">
			{% block popup_header %}
			<header>
				<div>
					<h1><a href="{% url 'admin:cms_index' %}">{% block branding %}{% endblock %}</a></h1>
					<nav role="user-tools">
						{% if user.is_active and user.is_staff %}
							<p>{% trans 'Welcome back' %} <strong>{% filter force_escape %}{% firstof user.first_name user.username|title %}{% endfilter %}</strong></p>
							{% block userlinks %}
							<a href="{% url 'admin:cms_password_change' %}">{% trans 'Change password' %}</a>
	                        {% user_url request.user bundle as user_url %}
							{% if user_url %}<a href="{{ user_url }}">{% trans 'Administration' %}</a>{% endif %}
							<a href="{% url 'admin:cms_logout' %}">{% trans 'Logout' %}</a>
							{% endblock %}
						{% endif %}
						{% block nav-global %}{% endblock %}
					</nav>
				</div>
			</header>
			<nav role="{% block nav-role %}navbar{% endblock %}">
				{% block dashboard %}
				<ul>
				{% for navs in dashboard %}
					<li>{{ navs.0 }}<ul>
					{% for nav in navs.1 %}
						<li><a href="{{ nav.0 }}">{{ nav.1 }}</a></li>
					{% endfor %}
					</ul></li>
				{% endfor %}
				</ul>
				{% endblock %}
			</nav>
			{% block object_header %}{% endblock %}
			{% endblock popup_header %}
			<section id="main" role="main">
				<div>
				{% block messages %}
					{% if messages %}
					<ul class="messagelist">
					{% for message in messages %}
						<li class="{% if message.tags %}{{ message.tags }}{% endif %}">{{ message }}</li>
					{% endfor %}
					</ul>
					{% endif %}
				{% endblock messages %}

				{% block aside %}
					{% if navigation %}
					<nav role="sidebar">
						{% for nav in navigation %}
							<a href="{{ nav.0 }}">{{ nav.1 }}</a>
						{% endfor %}
					</nav>
					{% endif %}
				{% endblock %}

				<article id="content" class="{% block content_class %}{% endblock %}">
				{% block content %}
				{% endblock %}
				</article>

				</div>
				<article id="modal"></article>
			</section>
		</div>
		{% block popup_footer %}
		<footer>
			<div>
				{% block footer %}
				Developed by <a href="//ff0000.com" target="_blank">RED Interactive Agency</a>
				{% endblock %}
			</div>
		</footer>
		{% endblock popup_footer %}
		<script src="{{STATIC_URL}}scarlet/js/libs/require.js"></script>
        <script src="{{STATIC_URL}}scarlet/js/config.js"></script>
		{% if settings.TEMPLATE_DEBUG %}

		<script>
			require.config({
				baseUrl : "{{STATIC_URL}}scarlet/js",
				urlArgs : "cacheBust=" + (new Date()).getTime()
			});
		</script>
		{% else %}
		<script>
			require.config({
				baseUrl : "{{STATIC_URL}}scarlet/js",
				paths : {
					"admin/Site" : "admin"
				}
			});
		</script>
		{% endif %}
		<script>
			require(["$"], function ($) {
				define("jquery", $)

				require(["admin/Site"], function (Site) {
					Site.initialize();
				});
			});
		</script>
		{# Chrome Frame prompt for IE9 and below. #}
		{# See: project/static/js/rosy/modules/google-chrome-frame for more info. #}
		<!--[if lte IE 9]>
		<script>
			require(["ChromeFrame"]);
		</script>
		<![endif]-->
	</body>
</html>
{% endspaceless %}
