Barvičky jdou vypnout
This commit is contained in:
parent
fe144e6de7
commit
d304e46ceb
3 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
Od data (vyjma): {{ filtr.reseni_od }}
|
||||
Do data (včetně): {{ filtr.reseni_do }}
|
||||
<span title="Jen neobodovaná řešení">🔨?</span> {{ filtr.neobodovane }}
|
||||
<span title="Obarvit shodná řešení shodně">🎨?</span> {{ filtr.barvicky }}
|
||||
<input type=submit value="→">
|
||||
</form>
|
||||
|
||||
|
@ -40,7 +41,7 @@ Do data (včetně): {{ filtr.reseni_do }}
|
|||
{% for soucet,bunka in hodnoty %}
|
||||
<td>
|
||||
{% for reseni,hodnoceni in bunka %}
|
||||
<a style="color: {{reseni|barva_reseni}};" href="{% url 'odevzdavatko_detail_reseni' pk=reseni.id %}">
|
||||
<a {% if barvicky %} style="color: {{reseni|barva_reseni}};" {% endif %} href="{% url 'odevzdavatko_detail_reseni' pk=reseni.id %}">
|
||||
{{reseni.cas_doruceni | date:"j. n."}} ({{ hodnoceni.body|default_if_none:"🔨"}} b)
|
||||
</a><br>
|
||||
{% endfor %}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue