Voting update

Nu met 100% meer mogelijkheid tot stemmen. Top.
This commit is contained in:
2024-02-07 00:04:01 +01:00
parent d1aabd53dc
commit 0f5090cadc
10 changed files with 82 additions and 14 deletions
+21
View File
@@ -0,0 +1,21 @@
<html>
<head>
{% load static %}
<script src="{% static 'js/htmx.min.js' %}" defer></script>
</head>
<body>
<header>
<nav>
<ul hx-boost="true">
<li><a href="{% url 'vote' %}">Stemmen</a></li>
<li><a href="{% url 'nominate' %}">Nomineren</a></li>
<li><a href="/">Statistieken</a></li>
</ul>
</nav>
<h1>{% block page-name %}Muzak{% endblock %}</h1>
</header>
<main>
{% block main-content %}{% endblock %}
</main>
</body>
</html>
+13 -9
View File
@@ -1,9 +1,13 @@
{% if user.is_authenticated %}
<p>Current user: {{ user.email }}</p>
<form action="{% url 'oidc_logout' %}" method="post">
{% csrf_token %}
<input type="submit" value="logout">
</form>
{% else %}
<a href="{% url 'oidc_authentication_init' %}">Login</a>
{% endif %}
{% extends "Base.html" %}
{% block main-content %}
{% if user.is_authenticated %}
<p>Current user: {{ user.email }}</p>
<form action="{% url 'oidc_logout' %}" method="post">
{% csrf_token %}
<input type="submit" value="logout">
</form>
{% else %}
<a href="{% url 'oidc_authentication_init' %}">Login</a>
{% endif %}
{% endblock %}
+4
View File
@@ -1,6 +1,10 @@
{% extends "Base.html" %}
{% block main-content %}
<h2>Nominate</h2>
<form method="post">
{% csrf_token %}
<input type="text" name="spotify_link" placeholder="Spotify-link">
<input type="submit" value="OK">
</form>
{% endblock %}
+6
View File
@@ -0,0 +1,6 @@
<div id="vote-box" hx-boost="true" hx-target="#vote-box">
<iframe src="https://open.spotify.com/embed/track/{{ id }}"
class="play-sample" width="300" height="380" frameborder="0" allowtransparency="true"
allow="encrypted-media"></iframe>
<a href="{% url 'vote-track'%}">Ja</a> | <a href="{% url 'vote-track' %}">Nee</a>
</div>
+12
View File
@@ -0,0 +1,12 @@
{% extends "Base.html" %}
{% block main-content %}
{% for song in songs %}
{{ song }}
{% endfor %}
<div hx-get="{% url 'vote-track' %}" hx-trigger="load">
etst
</div>
{% endblock %}