From 1fe8d8aa51ba99b1d725266898b1860abab45f09 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 9 Sep 2024 12:56:42 -0400 Subject: [PATCH] [boardgames] Add better list template and fix URLs (also for moods) --- vrobbler/apps/boardgames/urls.py | 6 +- vrobbler/apps/moods/urls.py | 4 +- .../templates/boardgames/boardgame_list.html | 77 +++++-------------- 3 files changed, 25 insertions(+), 62 deletions(-) diff --git a/vrobbler/apps/boardgames/urls.py b/vrobbler/apps/boardgames/urls.py index acd1fcd..0e77e81 100644 --- a/vrobbler/apps/boardgames/urls.py +++ b/vrobbler/apps/boardgames/urls.py @@ -6,10 +6,12 @@ app_name = "boardgames" urlpatterns = [ path( - "board-game/", views.BoardGameListView.as_view(), name="boardgame_list" + "board-games/", + views.BoardGameListView.as_view(), + name="boardgame_list", ), path( - "board-game//", + "board-games//", views.BoardGameDetailView.as_view(), name="boardgame_detail", ), diff --git a/vrobbler/apps/moods/urls.py b/vrobbler/apps/moods/urls.py index 452f079..85f5e97 100644 --- a/vrobbler/apps/moods/urls.py +++ b/vrobbler/apps/moods/urls.py @@ -5,9 +5,9 @@ app_name = "moods" urlpatterns = [ - path("mood/", views.MoodListView.as_view(), name="mood-list"), + path("moods/", views.MoodListView.as_view(), name="mood-list"), path( - "mood//", + "moods//", views.MoodDetailView.as_view(), name="mood-detail", ), diff --git a/vrobbler/templates/boardgames/boardgame_list.html b/vrobbler/templates/boardgames/boardgame_list.html index 78a3047..2ecb23d 100644 --- a/vrobbler/templates/boardgames/boardgame_list.html +++ b/vrobbler/templates/boardgames/boardgame_list.html @@ -1,82 +1,43 @@ {% extends "base_list.html" %} -{% load urlreplace %} -{% block title %}Albums{% endblock %} +{% block title %}Board Games{% endblock %} + +{% block head_extra %} + +{% endblock %} {% block lists %} -
-

- - {% if view == 'grid' %} - View as List - {% else %} - View as Grid - {% endif %} - -

-

- - {% if page_obj.has_previous %} - prev - {% endif %} - - Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} - - {% if page_obj.has_next %} - next - {% endif %} - -

-
- {% if view == 'grid' %} -
- {% for game in object_list %} - {% if game.cover %} -
-
-
- {% endif %} - {% endfor %} -
- {% else %}
+ - - + - {% for game in object_list %} + {% for obj in object_list %} - - - + + {% if request.user.is_authenticated %} + + + {% endif %} {% endfor %}
Title ScrobblesNamePublisherStart
{{game.scrobbles.count}}{{game}}{{game.publisher}}{{obj}}{{obj.scrobble_count}}Scrobble
- {% endif %} - -
{% endblock %} +