{% load cache %}
{% load static %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>{% block subtitle %}{% endblock %}</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta http-equiv="Content-Language" content="utf-8" />
	<link rel="Shortcut Icon" href="{% static "images/favicon.png" %}" />
	<link rel="stylesheet" type="text/css" href="{% static "style/jquery/ui/jquery-ui-1.12.1.css" %}" />
	<link rel="stylesheet" type="text/css" href="{% static "style/base.css" %}" media="screen" />
	<link rel="stylesheet" type="text/css" href="{% static "style/print.css" %}" media="print" />
	{% block custom_stylesheet %}{% endblock %}
	<script type="text/javascript" src="{% static "js/lib/jquery-3.5.1.js" %}"></script>
	<script type="text/javascript" src="{% static "js/lib/jquery-ui-1.12.1.js" %}"></script>
	<script type="text/javascript" src="{% static "js/lib/handlebars-1.3.0.min.js" %}"></script>
	<script type="text/javascript" language="javascript" charset="utf-8">
		jQuery.noConflict();
		let jQ = jQuery;
		// Top level namespace
		window.Nitrate = {};
	</script>
	<script type="text/javascript" src="{% static "js/lib/jquery.shiftcheckbox.js" %}"></script>
	<script type="text/javascript" src="{% static "js/tcms_actions.js" %}"></script>
	{% block custom_javascript %}{% endblock %}
	<script type="text/javascript">
	window.__admin_media_prefix__ = "{% static "admin/" %}";
	{% if request.user.is_authenticated %}
	Nitrate.User = {
		pk: {{ request.user.pk }},
		username: '{{ request.user.username }}',
		email: '{{ request.user.email }}',
	};
	{% else %}
	Nitrate.User = {
		pk: null,
		username: 'anonymous',
		email: 'anonymous@anywhere.com',
	};
	{% endif %}
	</script>
	{% block extra_head %}{% endblock %}
</head>
<body id="body">
	{% include "csrf.html" %}
	<div id="header">
		<div class="logo">
		<a href="{% url "nitrate-index" %}"><img src="{% static "images/logo_shipshape_1.png" %}" alt="logo" /></a>
		</div>
		<div class="absoluteright">
		<label>
			{% if user.is_authenticated %}
			<a href="{% url "user-profile" user.username %}">Welcome, {{ user }}</a>
			<span>[</span><a href="{% url "nitrate-logout" %}?next={{ request.path }}">Logout</a><span>]</span>
			{% else %}
			Welcome, Guest.
			[
			<a href="{% url "nitrate-login" %}?next={{ request.path }}" class="banner_login">Login</a>
			]
			{% endif %}
			<a class="sprites userguide" href="{{ SETTINGS.USER_GUIDE_URL }}" target="_blank">User Guide</a>
		</label>
		</div>
		{% include 'menu.html' %}
	</div>
	{% block contents %}{% endblock %}
	<div id="dialog" style="display:none"><div class="ajax_loading"></div></div>
	{% cache 600 footerbar%}
	<div id="footer">
		{% if SETTINGS.FOOTER_LINKS %}
		<div class="footercontent">
			{% for link in SETTINGS.FOOTER_LINKS %}
			<a href="{{ link.0 }}">{{ link.1 }}</a>{% if not forloop.last %}|{% endif %}
			{% endfor %}
		</div>
		{% endif %}
		<div class="center"><span>Nitrate {{ SETTINGS.NITRATE_VERSION }} &copy; {% now "Y" %} Nitrate Team</span></div>
	</div>
	{% endcache %}

	{# global message dialog #}
	<div id="messageDialog" style="display:none">
		<p id="dialogShowMessage"></p>
	</div>

	{# global message dialog #}
	<div id="confirmDialog" style="display:none">
		<p id="confirmMessage"></p>
	</div>

	<script type="text/javascript">
		jQ(window).on('load', function() {
			jQ('#js-execute-search').on('click', function() {
			  jQ('#search_content').val() === '' || this.form.submit();
			});
		});
	</script>
</body>
</html>
