From c35b539c4224776cfeabf73aa7e40afc57484378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Fri, 17 Nov 2023 21:20:33 +0100 Subject: [PATCH] Merge sessions and notes --- games/static/base.css | 9 +++++++++ games/templates/view_game.html | 26 +++++--------------------- games/views.py | 2 +- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/games/static/base.css b/games/static/base.css index 07970f4..74cff7a 100644 --- a/games/static/base.css +++ b/games/static/base.css @@ -808,6 +808,10 @@ select { margin-bottom: 2.5rem; } +.mb-2 { + margin-bottom: 0.5rem; +} + .mb-4 { margin-bottom: 1rem; } @@ -1405,6 +1409,11 @@ th label { background-color: rgb(17 24 39 / var(--tw-bg-opacity)); } +:is(.dark .dark\:text-slate-400) { + --tw-text-opacity: 1; + color: rgb(148 163 184 / var(--tw-text-opacity)); +} + :is(.dark .dark\:text-slate-500) { --tw-text-opacity: 1; color: rgb(100 116 139 / var(--tw-text-opacity)); diff --git a/games/templates/view_game.html b/games/templates/view_game.html index 44b0d7a..b28cba5 100644 --- a/games/templates/view_game.html +++ b/games/templates/view_game.html @@ -60,34 +60,18 @@ ({{ sessions.count }}) {% url 'start_game_session' game.id as add_session_link %} {% include 'components/button.html' with title="Start new session" text="New" link=add_session_link %} + and Notes ({{ sessions_with_notes_count }}) + -

- Notes ({{ sessions_with_notes.count }}) -

- diff --git a/games/views.py b/games/views.py index 092e480..6593173 100644 --- a/games/views.py +++ b/games/views.py @@ -179,7 +179,7 @@ def view_game(request, game_id=None): "purchase_count": Purchase.objects.filter(edition__game=game).count(), "session_average": round(total_hours / int(session_count), 1), "session_count": session_count, - "sessions_with_notes": sessions.exclude(note=""), + "sessions_with_notes_count": sessions.exclude(note="").count(), "sessions": sessions.order_by("-timestamp_start"), "title": f"Game Overview - {game.name}", "hours_sum": total_hours,