Browse Source

Update templates (remove CMS), improve testdata gen

remotes/origin/feincms
Tomas Gavenciak 10 years ago
parent
commit
4b855c6f77
  1. 3
      mamweb/templates/base.html
  2. 6
      seminar/templates/seminar/problem.html
  3. 4
      seminar/tests.py

3
mamweb/templates/base.html

@ -1,4 +1,4 @@
{% load cms_tags staticfiles sekizai_tags menu_tags %}
{% load staticfiles sekizai_tags %}
<!DOCTYPE html>
<html lang='cs'>
<head>
@ -12,7 +12,6 @@
<script src="{% static 'js/jquery-1.11.1.js' %}"></script>
</head>
<body class='{% if True %}org-logged-in{% endif %}'>
{% cms_toolbar %}
<div class="container">
<div class='header'>
Korespondenční seminář M&amp;M

6
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 %}
<div>
<h2>Problém {{ problem.nazev }}</h2>
<h3>Text</h3>
{% render_placeholder problem.text_problemu %}
{{ problem.text_problemu |safe }}
{% if True %}
<div class='mam-org-only'>
<h3>Text - org</h3>
{% render_placeholder problem.text_problemu_org %}
{{ problem.text_problemu_org |safe }}
</div>
{% endif %}

4
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"<p>Text problému <strong>%s.%s %s</strong><em> [id %d]</em> za %d body.</p>" %
(p.cislo_zadani.kod(), p.kod, p.nazev, p.id, p.body))
p.text_problemu_org = u"<p><strong>Neveřejný</strong> text problému.</p>"
p.save()
for resi in range(rnd.randint(0, 7)):
res = Reseni.objects.create(problem = p, resitel = rnd.choice(Resitel.objects.all()),

Loading…
Cancel
Save