diff --git a/seminar/templates/seminar/archiv/cislo.html b/seminar/templates/seminar/archiv/cislo.html index 02b6f6f8..b7b11a1c 100644 --- a/seminar/templates/seminar/archiv/cislo.html +++ b/seminar/templates/seminar/archiv/cislo.html @@ -8,14 +8,14 @@

Zadané problémy

Řešené problémy

diff --git a/seminar/views.py b/seminar/views.py index 2f570667..b4139989 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -200,6 +200,12 @@ class CisloView(generic.DetailView): vysledky = VysledkyKCisluZaRocnik.objects.filter(cislo = context['cislo']).order_by('-body', 'resitel__prijmeni', 'resitel__jmeno') reseni = Reseni.objects.filter(cislo_body = context['cislo']).select_related("resitel") + # typy úloh, které se mají zobrazovat u čísla, tj. těch, které byly v čísle skutečně zadány + typy_skutecne_zadanych = [Problem.TYP_ULOHA, Problem.TYP_SERIAL, Problem.TYP_ORG_CLANEK] + v_cisle_zadane = Problem.objects.filter(cislo_zadani=context['cislo']).filter(typ__in=typy_skutecne_zadanych).order_by('cislo_reseni__cislo', 'kod') + + resene_problemy = Problem.objects.filter(cislo_reseni=context['cislo']).filter(typ__in=typy_skutecne_zadanych).order_by('cislo_reseni__cislo', 'kod') + problemy = sorted(list(set([r.problem for r in reseni])), key=lambda x:(0 if x.typ==Problem.TYP_ULOHA else 1,x.kod)) #setridi problemy podle typu a poradi zadani problem_index = {} @@ -264,6 +270,8 @@ class CisloView(generic.DetailView): context['vysledkovka'] = vysledkovka context['problemy'] = problemy + context['v_cisle_zadane'] = v_cisle_zadane + context['resene_problemy'] = resene_problemy return context ### Generovani vysledkovky