From d6fb16bb74dc8431f723b3b3e32a019497c6ab2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Thu, 2 Nov 2023 09:52:42 +0100 Subject: [PATCH] Make navigation more compact --- CHANGELOG.md | 3 +++ games/static/base.css | 36 ++++++++++++++++++++++++++++++++ games/templates/base.html | 43 +++++++++++++++++++++++++++------------ games/views.py | 4 ++++ timetracker/settings.py | 1 + 5 files changed, 74 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c27b267..a4969e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ * Add Stats to the main navigation * Allow selecting year on the Stats page +### Improved +* Make navigation more compact + ### Fixed * Correctly limit sessions to a single year for stats diff --git a/games/static/base.css b/games/static/base.css index b8c5172..e159d66 100644 --- a/games/static/base.css +++ b/games/static/base.css @@ -755,6 +755,10 @@ select { position: absolute; } +.relative { + position: relative; +} + .bottom-2 { bottom: 0.5rem; } @@ -876,6 +880,10 @@ select { width: 1.75rem; } +.w-auto { + width: auto; +} + .w-full { width: 100%; } @@ -962,6 +970,11 @@ select { border-color: rgb(100 116 139 / var(--tw-border-opacity)); } +.bg-gray-200 { + --tw-bg-opacity: 1; + background-color: rgb(229 231 235 / var(--tw-bg-opacity)); +} + .bg-green-600 { --tw-bg-opacity: 1; background-color: rgb(22 163 74 / var(--tw-bg-opacity)); @@ -986,6 +999,11 @@ select { padding-right: 0.5rem; } +.px-4 { + padding-left: 1rem; + padding-right: 1rem; +} + .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; @@ -1004,6 +1022,10 @@ select { padding-right: 1rem; } +.pt-1 { + padding-top: 0.25rem; +} + .text-center { text-align: center; } @@ -1055,6 +1077,11 @@ select { font-style: italic; } +.text-gray-700 { + --tw-text-opacity: 1; + color: rgb(55 65 81 / var(--tw-text-opacity)); +} + .text-slate-300 { --tw-text-opacity: 1; color: rgb(203 213 225 / var(--tw-text-opacity)); @@ -1290,6 +1317,11 @@ th label { box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } +.hover\:bg-gray-400:hover { + --tw-bg-opacity: 1; + background-color: rgb(156 163 175 / var(--tw-bg-opacity)); +} + .hover\:bg-green-700:hover { --tw-bg-opacity: 1; background-color: rgb(21 128 61 / var(--tw-bg-opacity)); @@ -1337,6 +1369,10 @@ th label { --tw-ring-offset-color: #ddd6fe; } +.group:hover .group-hover\:block { + display: block; +} + :is(.dark .dark\:bg-gray-800) { --tw-bg-opacity: 1; background-color: rgb(31 41 55 / var(--tw-bg-opacity)); diff --git a/games/templates/base.html b/games/templates/base.html index f06b17e..0e8b35f 100644 --- a/games/templates/base.html +++ b/games/templates/base.html @@ -25,20 +25,37 @@
diff --git a/games/views.py b/games/views.py index a062dba..d2de0b6 100644 --- a/games/views.py +++ b/games/views.py @@ -30,6 +30,10 @@ def model_counts(request): } +def stats_dropdown_year_range(request): + return {"stats_dropdown_year_range": range(2022, 2024)} + + def add_session(request): context = {} initial = {} diff --git a/timetracker/settings.py b/timetracker/settings.py index 06df532..b13551a 100644 --- a/timetracker/settings.py +++ b/timetracker/settings.py @@ -68,6 +68,7 @@ TEMPLATES = [ "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", "games.views.model_counts", + "games.views.stats_dropdown_year_range", ], }, },