From: Radek Czajka Date: Tue, 25 Feb 2014 15:50:42 +0000 (+0100) Subject: Fixes #3314, #3331: Various minor fixes. X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/873c22275a94e60243469f1b7f0eedb7b2e76f39?ds=sidebyside Fixes #3314, #3331: Various minor fixes. --- diff --git a/catalogue/models.py b/catalogue/models.py index 4af4810..55ee821 100644 --- a/catalogue/models.py +++ b/catalogue/models.py @@ -168,10 +168,14 @@ class Lesson(models.Model): def populate_description(self, wldoc=None, infile=None): if wldoc is None: wldoc = self.wldocument(infile) - for nagl in wldoc.edoc.findall('.//naglowek_rozdzial'): - if (nagl.text or '').strip() == u'Pomysł na lekcję': + if self.type == 'project': + lookup = u'Zadanie' + else: + lookup = u'Pomysł na lekcję' + for header in wldoc.edoc.findall('.//naglowek_rozdzial'): + if (header.text or '').strip() == lookup: from lxml import etree - self.description = etree.tostring(nagl.getnext(), + self.description = etree.tostring(header.getnext(), method='text', encoding='unicode').strip() self.save() return diff --git a/catalogue/templates/catalogue/lesson/course/lesson_detail.html b/catalogue/templates/catalogue/lesson/course/lesson_detail.html index 28f6504..38ef906 100755 --- a/catalogue/templates/catalogue/lesson/course/lesson_detail.html +++ b/catalogue/templates/catalogue/lesson/course/lesson_detail.html @@ -8,7 +8,7 @@ {% include "catalogue/lesson/box-icons.html" %}

Ta lekcja jest częścią tematu - {{ object.section }} + {{ object.section }} na poziomie {{ object.level|lower }}.

diff --git a/catalogue/templates/catalogue/lesson/project/lesson_detail.html b/catalogue/templates/catalogue/lesson/project/lesson_detail.html index 0c6d217..7a17251 100755 --- a/catalogue/templates/catalogue/lesson/project/lesson_detail.html +++ b/catalogue/templates/catalogue/lesson/project/lesson_detail.html @@ -11,7 +11,7 @@

To jest projekt na poziomie - {{ object.level|lower }}. + {{ object.level|lower }}.

{% endblock %} diff --git a/catalogue/templates/catalogue/snippets/level_box.html b/catalogue/templates/catalogue/snippets/level_box.html index bb2fa12..e51be2a 100755 --- a/catalogue/templates/catalogue/snippets/level_box.html +++ b/catalogue/templates/catalogue/snippets/level_box.html @@ -16,14 +16,14 @@ {% endif %} {% if lessons.project %} -
  • Projekt
  • +
  • Projekty
  • {% endif %} {% if lessons.appendix %}
  • Pozostałe materiały
  • {% endif %} {% if courses %} -
  • Wg postawy programowej +
  • Według postawy programowej