Files
muzak/playlist/templates/Base.html
T
mark ae7268736f settings panel
With first draft version of wallpaper changer
2024-02-21 13:27:07 +01:00

66 lines
2.1 KiB
HTML

{% load static %}
<html>
<head>
{% include "head.html" %}
</head>
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
<script>setWallpaper()</script>
<div class="window" id="main-window">
<div class="title-bar main-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 == '/settings/' %}aria-selected="true" {% endif %}>
<a href="{% url 'settings' %}">Instellingen</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('.main-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>