From b080636baa04116dab8b53a7af4be266e0a0b59d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Koci=C3=A1n?= Date: Mon, 7 Sep 2015 11:18:22 +0200 Subject: [PATCH] =?UTF-8?q?Aktu=C3=A1ln=C3=AD=20zad=C3=A1n=C3=AD:=20t?= =?UTF-8?q?=C3=A9mata=20na=20konec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/seminar/zadani/AktualniZadani.html | 13 ++++++++++--- seminar/views.py | 7 ++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/seminar/templates/seminar/zadani/AktualniZadani.html b/seminar/templates/seminar/zadani/AktualniZadani.html index 3a6b215a..ae2dfd60 100644 --- a/seminar/templates/seminar/zadani/AktualniZadani.html +++ b/seminar/templates/seminar/zadani/AktualniZadani.html @@ -10,16 +10,16 @@ {% endif %} {#TODO a co speciální deadline pro účast na soustředění? #} - {% for sada in problemy %} + {% for sada in jednorazove_problemy %} {# podnadpisy, kdyz neni zakomentuje se nadpis #} {% if not sada %}{% endif %} {# publikace jednotlivych zadani #} {% for problem in sada %} {# TODO použít {{problem.kod_v_rocniku}} ? vrací 4.u1 místo 4.1 #}

{{problem.cislo_zadani.cislo}}.{{problem.kod}} {{problem.nazev}} - {# nezobrazuj body, pokud nejsou zadane (typicky u temat)#} + {# nezobrazuj body, pokud nejsou zadane #} {% if problem.body %}({{problem.body}}b){% endif %}

{% autoescape off %}{{problem.text_zadani}}{% endautoescape %}
@@ -28,6 +28,13 @@ Aktuálně nejsou zadané žádné úlohy k řešení. {% endfor %} +

Témata

+ {% for tema in temata %} +

Téma {{tema.kod}}: {{tema.nazev}}

+ Stránka tématu + {% autoescape off %}{{tema.text_zadani}}{% endautoescape %} + {% endfor %} + {% endwith %} diff --git a/seminar/views.py b/seminar/views.py index f9708fc9..9025ff84 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -16,12 +16,13 @@ def AktualniZadaniView(request): nastaveni = get_object_or_404(Nastaveni) problemy = Problem.objects.filter(cislo_zadani=nastaveni.aktualni_cislo).filter(stav = 'zadany') ulohy = problemy.filter(typ = 'uloha') - temata = problemy.filter(typ = 'tema') serialy = problemy.filter(typ = 'serial') - problemy = [ulohy, temata, serialy] + temata = problemy.filter(typ = 'tema') + jednorazove_problemy = [ulohy, serialy] return render(request, 'seminar/zadani/AktualniZadani.html', {'nastaveni': nastaveni, - 'problemy': problemy, + 'jednorazove_problemy': jednorazove_problemy, + 'temata': temata, }, )