Spotify user api integration

En een begin aan een playlist maker. Doet op het moment niet veel.
This commit is contained in:
2024-03-13 11:01:23 +01:00
parent aba8d64bed
commit 8dca25f861
15 changed files with 258 additions and 39 deletions
+22
View File
@@ -0,0 +1,22 @@
{% extends "Base.html" %}
{% block window-title %}
Nomineren
{% endblock %}
{% block main-content %}
{% if tracks %}
{% for track in tracks %}
<p>{{track}}: {{track.score}}</p>
{% endfor %}
{% else %}
<form method="post">
{% csrf_token %}
Hoe veel nummers wil je?
<input type="number" id="count" name="count">
<input type="submit" value="OK" >
</form>
{% endif %}
{% endblock %}
+22 -5
View File
@@ -13,6 +13,24 @@ Instellingen
<input type="submit" value="" class="icon admin-panel" />
</div>
</form>
{% if sptDisplayName %}
<form method="post">
{% csrf_token %}
<div class="field-row settings">
<label>Spotify gekoppeld:</label>
<span>{{sptDisplayName}}</span>
<input type="hidden" id="unlink-spotify" name="unlink-spotify" value="true" />
<input type="submit" id="spotify-cancel" value=""/>
</div>
</form>
{% else %}
<form action="{% url 'spotify' %}">
<div class="field-row settings">
<label>Link je spotify:</label>
<input type="submit" value="" class="icon spotify" />
</div>
</form>
{% endif %}
{% endif %}
<form method="post">
{% csrf_token %}
@@ -32,9 +50,8 @@ Instellingen
</div>
{% endif %}
</form>
<div class="field-row settings">
<label>Nominatie quota:</label>
<span>{{user.profile.quota|floatformat:3}}</span>
</div>
</form>
<div class="field-row settings">
<label>Nominatie quota:</label>
<span>{{user.profile.quota|floatformat:3}}</span>
</div>
{% endblock %}
+13 -13
View File
@@ -18,18 +18,6 @@ Stemmen
<fieldset>
<legend>Hoeveel sterren geef jij dit?</legend>
<div class="star-wrapper">
<a
hx-vals='{"vote": "-2"}'
hx-post="{% url 'vote' %}"
></a>
<a
hx-vals='{"vote": "-1"}'
hx-post="{% url 'vote' %}"
></a>
<a
hx-vals='{"vote": "0"}'
hx-post="{% url 'vote' %}"
></a>
<a
hx-vals='{"vote": "1"}'
hx-post="{% url 'vote' %}"
@@ -38,13 +26,25 @@ Stemmen
hx-vals='{"vote": "2"}'
hx-post="{% url 'vote' %}"
></a>
<a
hx-vals='{"vote": "3"}'
hx-post="{% url 'vote' %}"
></a>
<a
hx-vals='{"vote": "4"}'
hx-post="{% url 'vote' %}"
></a>
<a
hx-vals='{"vote": "5"}'
hx-post="{% url 'vote' %}"
></a>
</div>
</fieldset>
{% if undo %}
<!--<form class="undo-wrapper" method="post" action="{% url 'undo' %}" hx-vals='{"spotify_id": "{{ undo.track.id }}"}' >-->
<div class="undo-wrapper" hx-vals='{"spotify_id": "{{ undo.track.id }}"}' >
{% csrf_token %}
<p>Je hebt {{undo.track}} een score van {{undo.points | add:3}} sterren gegeven!</p>
<p>Je hebt {{undo.track}} een score van {{undo.points}} sterren gegeven!</p>
<button class="undo" hx-post="{% url 'undo' %}" >Undo</button>
</div>
{% endif %}