From d304e46ceb3499aed5e62b7f6a53aa4f41522ce8 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Tue, 23 May 2023 00:28:13 +0200 Subject: [PATCH] =?UTF-8?q?Barvi=C4=8Dky=20jdou=20vypnout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odevzdavatko/forms.py | 2 ++ odevzdavatko/templates/odevzdavatko/tabulka.html | 3 ++- odevzdavatko/views.py | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/odevzdavatko/forms.py b/odevzdavatko/forms.py index 223d807f..8fdd1e21 100644 --- a/odevzdavatko/forms.py +++ b/odevzdavatko/forms.py @@ -196,6 +196,7 @@ class OdevzdavatkoTabulkaFiltrForm(forms.Form): 'reseni_od': terminy[-2] if rocnik is None else terminy[0], 'reseni_do': terminy[-1], 'neobodovane': False, + 'barvicky': True, } return initial @@ -220,3 +221,4 @@ class OdevzdavatkoTabulkaFiltrForm(forms.Form): reseni_od = forms.DateField(input_formats=[DATE_FORMAT]) reseni_do = forms.DateField(input_formats=[DATE_FORMAT]) neobodovane = forms.BooleanField(required=False) + barvicky = forms.BooleanField(required=False) diff --git a/odevzdavatko/templates/odevzdavatko/tabulka.html b/odevzdavatko/templates/odevzdavatko/tabulka.html index 5fd3b8db..7cd317e5 100644 --- a/odevzdavatko/templates/odevzdavatko/tabulka.html +++ b/odevzdavatko/templates/odevzdavatko/tabulka.html @@ -12,6 +12,7 @@ Od data (vyjma): {{ filtr.reseni_od }} Do data (včetně): {{ filtr.reseni_do }} 🔨? {{ filtr.neobodovane }} +🎨? {{ filtr.barvicky }} @@ -40,7 +41,7 @@ Do data (včetně): {{ filtr.reseni_do }} {% for soucet,bunka in hodnoty %} {% for reseni,hodnoceni in bunka %} - + {{reseni.cas_doruceni | date:"j. n."}} ({{ hodnoceni.body|default_if_none:"🔨"}} b)
{% endfor %} diff --git a/odevzdavatko/views.py b/odevzdavatko/views.py index d5c7e4bc..a3838285 100644 --- a/odevzdavatko/views.py +++ b/odevzdavatko/views.py @@ -63,6 +63,7 @@ class TabulkaOdevzdanychReseniView(ListView): reseni_od = fcd["reseni_od"] reseni_do = fcd["reseni_do"] jen_neobodovane = fcd["neobodovane"] + self.barvicky = fcd["barvicky"] else: initial = FiltrForm.gen_initial(self.aktualni_rocnik) resitele = initial['resitele'] @@ -70,6 +71,7 @@ class TabulkaOdevzdanychReseniView(ListView): reseni_od = initial['reseni_od'][0] reseni_do = initial['reseni_do'][0] jen_neobodovane = initial["neobodovane"] + self.barvicky = initial["barvicky"] # Chceme jen letošní problémy @@ -161,6 +163,7 @@ class TabulkaOdevzdanychReseniView(ListView): ctx['form'] = ctx['filtr'] # Pro maximum v přesměrovátku ročníků ctx['aktualni_rocnik'] = m.Nastaveni.get_solo().aktualni_rocnik + ctx['barvicky'] = self.barvicky if 'rocnik' in self.kwargs: ctx['rocnik'] = self.kwargs['rocnik'] else: