nominate display fix
This commit is contained in:
@@ -10,15 +10,11 @@ class TrackManager(models.Manager):
|
|||||||
|
|
||||||
class Track(models.Model):
|
class Track(models.Model):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
s = f"'{self. id} | {self.name}'"
|
s = f"'{self.name}'"
|
||||||
if self.artists.count() > 0:
|
if self.artists.count() > 0:
|
||||||
artists = list(map(lambda a:a.name, self.artists.all()))
|
artists = list(map(lambda a:a.name, self.artists.all()))
|
||||||
s += " door "
|
s += " door "
|
||||||
s += " & ".join(artists)
|
s += " & ".join(artists)
|
||||||
dup = self.is_duplicate_of()
|
|
||||||
#dup = None
|
|
||||||
if dup:
|
|
||||||
s += f" !! Is een duplicaat van {dup.id}"
|
|
||||||
return s
|
return s
|
||||||
@property
|
@property
|
||||||
def artist(self):
|
def artist(self):
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
{% load static %}
|
|
||||||
<div
|
|
||||||
id="banter"
|
|
||||||
{% if not track.banter_done %}
|
|
||||||
hx-get="{% url 'track-banter' track.id %}"
|
|
||||||
hx-trigger="load delay:{% if track.banter %}500ms{% else %}5s{% endif %}"
|
|
||||||
{% endif %}
|
|
||||||
hx-swap="outerHTML"
|
|
||||||
hx-target="#banter"
|
|
||||||
>
|
|
||||||
{% include "Popup.html" with body=track.banter title=track img="img/draakje/draakje-headphones3.gif" %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -6,17 +6,15 @@ Nomineren
|
|||||||
|
|
||||||
{% block main-content %}
|
{% block main-content %}
|
||||||
{% if warning %}
|
{% if warning %}
|
||||||
<div class="info warning">{{warning}}</div>
|
<div class="info warning">{{nominated}}: {{warning}}</div>
|
||||||
{% endif %}
|
{% elif error %}
|
||||||
{% if error %}
|
<div class="info error">{{nominated}}: {{error}}</div>
|
||||||
<div class="info error">{{error}}</div>
|
{% elif nominated %}
|
||||||
|
<div class="info">{{nominated}} Genomineerd!</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<input type="text" name="spotify_link" placeholder="Spotify-link">
|
<input type="text" name="spotify_link" placeholder="Spotify-link">
|
||||||
<input type="submit" value="OK">
|
<input type="submit" value="OK">
|
||||||
</form>
|
</form>
|
||||||
{% if nominated %}
|
|
||||||
{% include "Banter.html" with track=nominated %}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user