50 lines
1.9 KiB
HTML
50 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>{% block title %}{% endblock %} - Titivillus</title>
|
|
<link rel="stylesheet" type="text/css" href="{{ static('base.css') }}">
|
|
<script>
|
|
function toggleHeaderCookie(state) {
|
|
let xhr = new XMLHttpRequest();
|
|
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);
|
|
}
|
|
function toggleHeader() {
|
|
if (document.getElementById('header').style.display == 'initial') {
|
|
document.getElementById('header').style.display = 'none';
|
|
document.getElementById('headerHidden').style.display = 'initial';
|
|
toggleHeaderCookie('on');
|
|
}
|
|
else {
|
|
document.getElementById('header').style.display = 'initial';
|
|
document.getElementById('headerHidden').style.display = 'none';
|
|
toggleHeaderCookie('off');
|
|
}
|
|
}
|
|
</script>
|
|
{% block head %}{% endblock %}
|
|
</head>
|
|
<body>
|
|
<ul id="header" class="header" style="{% if request.session.get("hide_header") == True %}display:none;{% else %}display:initial;{% endif %}">
|
|
<li><a onclick="toggleHeader();" href="javascript:void(0);">⤒</a></li>
|
|
<li><a href="{{ url('homepage:index') }}">Home</a></li>
|
|
{% block header %}{% endblock %}
|
|
</ul>
|
|
<ul id="headerHidden" class="header" style="{% if request.session.get("hide_header") == True %}display:initial;{% else %}display:none;{% endif %}">
|
|
<li><a onclick="toggleHeader();" href="javascript:void(0);">⤓</a></li>
|
|
</ul>
|
|
{#<br /> <!-- TODO: make this more exact. -->#}
|
|
<div id="pageMessages">
|
|
<ul class="pageMessages">
|
|
{% for message in get_messages(request) %}
|
|
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
<div id="content">{% block content %}{% endblock %}</div>
|
|
</body>
|
|
</html>
|