65 lines
2.0 KiB
HTML
65 lines
2.0 KiB
HTML
{% load static %}
|
|
<html>
|
|
<head>
|
|
{% include "head.html" %}
|
|
</head>
|
|
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
|
|
<div class="window" id="main-window">
|
|
<div class="title-bar">
|
|
<div class="title-bar-text">
|
|
{% block window-title %}{% endblock %}
|
|
</div>
|
|
<div class="title-bar-controls">
|
|
<button aria-label="Help" onclick="resetWindow()"></button>
|
|
<form action="{% url 'oidc_logout' %}" method="post">
|
|
{% csrf_token %}
|
|
<button aria-label="Close" onclick="hideWindow()"></button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="window-body">
|
|
<menu role="tablist" hx-boost="true">
|
|
<li role="tab" {% if request.path == '/vote/' %}aria-selected="true" {% endif %}>
|
|
<a href="{% url 'vote' %}">Stemmen</a>
|
|
</li>
|
|
<li role="tab" {% if request.path == '/track/' %}aria-selected="true" {% endif %}>
|
|
<a href="{% url 'nominate' %}">Nomineren</a>
|
|
</li>
|
|
<li role="tab" {% if request.path == '/' %}aria-selected="true" {% endif %}>
|
|
<a href="/">Statistieken</a>
|
|
</li>
|
|
</menu>
|
|
<div class="window" role="tabpanel">
|
|
<div class="window-body">
|
|
{% block main-content %}{% endblock %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% block clippy %}{% endblock %}
|
|
<script>
|
|
position.get_pos(); // Gets position from localStorage
|
|
interact('.title-bar').draggable({
|
|
listeners: {
|
|
move (event) {
|
|
position.x += event.dx
|
|
position.y += event.dy
|
|
event.target.parentElement.style.transform =
|
|
`translate(${position.x}px, ${position.y}px)`
|
|
},
|
|
}
|
|
})
|
|
|
|
function hideWindow() {
|
|
document.getElementById("main-window").classList.add("hide");
|
|
}
|
|
|
|
function resetWindow() {
|
|
position.reset()
|
|
document.getElementById("main-window").style.transform = '';
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|