From 4b855c6f777c4f314704245f3ef6bf058eb1f1e3 Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Sat, 14 Mar 2015 23:31:29 +0100 Subject: [PATCH] Update templates (remove CMS), improve testdata gen --- mamweb/templates/base.html | 3 +-- seminar/templates/seminar/problem.html | 6 +++--- seminar/tests.py | 4 ++++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mamweb/templates/base.html b/mamweb/templates/base.html index 34b06f60..ec7a70e9 100644 --- a/mamweb/templates/base.html +++ b/mamweb/templates/base.html @@ -1,4 +1,4 @@ -{% load cms_tags staticfiles sekizai_tags menu_tags %} +{% load staticfiles sekizai_tags %} @@ -12,7 +12,6 @@ - {% cms_toolbar %}
Korespondenční seminář M&M diff --git a/seminar/templates/seminar/problem.html b/seminar/templates/seminar/problem.html index b8731efa..26559344 100644 --- a/seminar/templates/seminar/problem.html +++ b/seminar/templates/seminar/problem.html @@ -1,17 +1,17 @@ {% extends "base.html" %} -{% load cms_tags staticfiles sekizai_tags menu_tags %} +{% load staticfiles sekizai_tags %} {% block content %}

Problém {{ problem.nazev }}

Text

- {% render_placeholder problem.text_problemu %} + {{ problem.text_problemu |safe }} {% if True %}

Text - org

- {% render_placeholder problem.text_problemu_org %} + {{ problem.text_problemu_org |safe }}
{% endif %} diff --git a/seminar/tests.py b/seminar/tests.py index 2b3338cf..7a83ede3 100644 --- a/seminar/tests.py +++ b/seminar/tests.py @@ -60,6 +60,10 @@ def create_test_data(): p = Problem.objects.create(autor = rnd.choice(orgs), cislo_zadani=cs[ci-2], cislo_reseni=cs[ci], opravovatel = rnd.choice(orgs), kod = str(pi), nazev = u'Dummy úloha %s-%s' % (seq[ci], seq[pi]), stav = Problem.STAV_ZADANY, typ = Problem.TYP_ULOHA, body = rnd.randint(1, 5)) + p.text_problemu = (u"

Text problému %s.%s %s [id %d] za %d body.

" % + (p.cislo_zadani.kod(), p.kod, p.nazev, p.id, p.body)) + p.text_problemu_org = u"

Neveřejný text problému.

" + p.save() for resi in range(rnd.randint(0, 7)): res = Reseni.objects.create(problem = p, resitel = rnd.choice(Resitel.objects.all()),