diff --git a/playlist/templates/PlaylistMaker.html b/playlist/templates/PlaylistDetail.html similarity index 97% rename from playlist/templates/PlaylistMaker.html rename to playlist/templates/PlaylistDetail.html index c3ac988..56ec7be 100644 --- a/playlist/templates/PlaylistMaker.html +++ b/playlist/templates/PlaylistDetail.html @@ -1,7 +1,7 @@ {% extends "Base.html" %} {% block window-title %} -Nomineren +Playlist - {% endblock %} {% block main-content %} diff --git a/playlist/templates/PlaylistList.html b/playlist/templates/PlaylistList.html new file mode 100644 index 0000000..ddb6323 --- /dev/null +++ b/playlist/templates/PlaylistList.html @@ -0,0 +1,9 @@ +{% extends "Base.html" %} + +{% block window-title %} +Overzicht - Playlists +{% endblock %} + +{% block main-content %} + +{% endblock %} \ No newline at end of file diff --git a/playlist/views.py b/playlist/views.py index 259ea37..81fa27c 100644 --- a/playlist/views.py +++ b/playlist/views.py @@ -7,7 +7,7 @@ from django.db.models import Avg from django.urls import reverse import re from collections import OrderedDict -from .models import Track, Artist, Album, Vote, Background, Profile +from .models import Track, Artist, Album, Vote, Background, Profile, Playlist from .utils import from_json, get_unvoted from .spotify import spt from .tasks import get_banter, get_and_dither_image @@ -201,12 +201,15 @@ class OverView(LoginRequiredMixin, View): class PlaylistListView(LoginRequiredMixin, View): def get(self, request, count=None): + context = { + "playlists": Playlist.objects.all() + } return TemplateResponse(request, "PlaylistList.html", context) def post(self, request): name = self.request.POST.get('name', None) if name: new_playlist = Playlist(name=name) - return TemplateResponse(request, "PlaylistList.html", context) + return TemplateResponse(request, "PlaylistList.html") return self.get(request, count=count)