2018-08-10 08:39:51 -04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2018-08-15 17:41:51 -04:00
|
|
|
<meta charset="utf-8">
|
2018-08-10 08:39:51 -04:00
|
|
|
<title>{% block title %}{% endblock %} - Titivillus</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="{{ static('base.css') }}">
|
|
|
|
<script>
|
|
|
|
function toggleHeaderCookie(state) {
|
|
|
|
let xhr = new XMLHttpRequest();
|
2018-08-10 13:06:33 -04:00
|
|
|
xhr.open('POST', '{{ url("set_session:index") }}', true);
|
|
|
|
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
|
|
|
xhr.setRequestHeader('X-CSRFToken', '{{ csrf_token }}');
|
|
|
|
xhr.send('hide_header=' + state);
|
2018-08-10 08:39:51 -04:00
|
|
|
}
|
|
|
|
function toggleHeader() {
|
|
|
|
if (document.getElementById('header').style.display == 'initial') {
|
|
|
|
document.getElementById('header').style.display = 'none';
|
|
|
|
document.getElementById('headerHidden').style.display = 'initial';
|
2018-08-10 13:06:33 -04:00
|
|
|
toggleHeaderCookie('on');
|
2018-08-10 08:39:51 -04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
document.getElementById('header').style.display = 'initial';
|
|
|
|
document.getElementById('headerHidden').style.display = 'none';
|
2018-08-10 13:06:33 -04:00
|
|
|
toggleHeaderCookie('off');
|
2018-08-10 08:39:51 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{% block head %}{% endblock %}
|
|
|
|
</head>
|
|
|
|
<body>
|
2018-08-10 13:06:33 -04:00
|
|
|
<ul id="header" class="header" style="{% if request.session.get("hide_header") == True %}display:none;{% else %}display:initial;{% endif %}">
|
2018-09-18 11:45:12 -04:00
|
|
|
<li><a onclick="toggleHeader();" href="javascript:void(0);">⏫</a></li>
|
2018-08-10 08:39:51 -04:00
|
|
|
<li><a href="{{ url('homepage:index') }}">Home</a></li>
|
|
|
|
{% block header %}{% endblock %}
|
|
|
|
</ul>
|
2018-08-10 13:06:33 -04:00
|
|
|
<ul id="headerHidden" class="header" style="{% if request.session.get("hide_header") == True %}display:initial;{% else %}display:none;{% endif %}">
|
2018-09-18 11:45:12 -04:00
|
|
|
<li><a onclick="toggleHeader();" href="javascript:void(0);">⏬</a></li>
|
2018-08-10 08:39:51 -04:00
|
|
|
</ul>
|
2018-08-16 15:43:43 -04:00
|
|
|
{#<br /> <!-- TODO: make this more exact. -->#}
|
2018-08-20 06:57:36 -04:00
|
|
|
<div id="pageMessages">
|
|
|
|
<ul class="pageMessages">
|
2018-08-10 19:15:27 -04:00
|
|
|
{% for message in get_messages(request) %}
|
|
|
|
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2018-08-20 06:57:36 -04:00
|
|
|
<div id="content">{% block content %}{% endblock %}</div>
|
2018-08-10 08:39:51 -04:00
|
|
|
</body>
|
|
|
|
</html>
|