Merge branch 'master' of atrey.karlin.mff.cuni.cz:/akce/MaM/MaMweb/mamweb
This commit is contained in:
commit
3233d443c4
2 changed files with 10 additions and 2 deletions
|
@ -8,14 +8,14 @@
|
|||
|
||||
<h3>Zadané problémy</h3>
|
||||
<ul>
|
||||
{% for p in cislo.zadane_problemy.all %}
|
||||
{% for p in v_cisle_zadane %}
|
||||
<li><a href='{{ p.verejne_url }}'>{{ p.kod_v_rocniku }} {{ p.nazev }} ({{ p.body }}b)</a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h3>Řešené problémy</h3>
|
||||
<ul>
|
||||
{% for p in cislo.resene_problemy.all %}
|
||||
{% for p in resene_problemy %}
|
||||
<li><a href='{{ p.verejne_url }}'>{{ p.kod_v_rocniku }} {{ p.nazev }} ({{ p.body }}b)</a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue