From 4a5465903e5c24822b1d9f68c69f71b5daf4bc45 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 20 Jun 2013 14:17:14 +0200 Subject: [PATCH 1/1] Various minor changes --- catalogue/models.py | 7 +++++++ .../templates/catalogue/snippets/lesson_nav.html | 8 ++++++++ .../templates/catalogue/snippets/section_box.html | 4 ++-- catalogue/templatetags/catalogue_tags.py | 1 + .../templates/curriculum/snippets/course_box.html | 2 +- curriculum/templatetags/curriculum_tags.py | 1 + edumed/contact_forms.py | 13 ++++++++++++- 7 files changed, 32 insertions(+), 4 deletions(-) diff --git a/catalogue/models.py b/catalogue/models.py index e20d58c..652f972 100644 --- a/catalogue/models.py +++ b/catalogue/models.py @@ -202,8 +202,15 @@ class Lesson(models.Model): ContentFile(buff.getvalue())) def get_syntetic(self): + if self.section is None: return None return self.section.syntetic_lesson(self.level) + def get_other_level(self): + if self.section is None: return None + other_levels = self.section.lesson_set.exclude(level=self.level) + if other_levels.exists(): + return other_levels[0].level + def get_previous(self): if self.section is None: return None try: diff --git a/catalogue/templates/catalogue/snippets/lesson_nav.html b/catalogue/templates/catalogue/snippets/lesson_nav.html index a2ff5ba..776c79f 100755 --- a/catalogue/templates/catalogue/snippets/lesson_nav.html +++ b/catalogue/templates/catalogue/snippets/lesson_nav.html @@ -23,3 +23,11 @@ {% endfor %} + +{% with other=lesson.get_other_level %} + {% if other %} +

Ten temat jest dostępny również na + poziomie + {% if other.slug == 'liceum' %}zaawansowanym{% else %}podstawowym{% endif %}.

+ {% endif %} +{% endwith %} diff --git a/catalogue/templates/catalogue/snippets/section_box.html b/catalogue/templates/catalogue/snippets/section_box.html index f7ad6e5..84f1eda 100755 --- a/catalogue/templates/catalogue/snippets/section_box.html +++ b/catalogue/templates/catalogue/snippets/section_box.html @@ -1,10 +1,10 @@ {% for level, types in lessons.items %} {% if level.slug == "liceum" %} -

Poziom zaawansowany +

{{section.title}}: poziom zaawansowany wróć do spisu treści

{% endif %} -
+
{% spaceless %} {% for lesson_type, lesson_list in types.items %}
diff --git a/catalogue/templatetags/catalogue_tags.py b/catalogue/templatetags/catalogue_tags.py index fd1fc62..abaa524 100755 --- a/catalogue/templatetags/catalogue_tags.py +++ b/catalogue/templatetags/catalogue_tags.py @@ -30,6 +30,7 @@ def section_box(section): lessons[lesson.level][lesson.type] = [] lessons[lesson.level][lesson.type].append(lesson) return { + "section": section, "lessons": lessons, } diff --git a/curriculum/templates/curriculum/snippets/course_box.html b/curriculum/templates/curriculum/snippets/course_box.html index b00c71a..c647b83 100755 --- a/curriculum/templates/curriculum/snippets/course_box.html +++ b/curriculum/templates/curriculum/snippets/course_box.html @@ -1,6 +1,6 @@ {% for level, types in lessons.items %} {% if level.slug == "liceum" %} -

Poziom zaawansowany +

{{ course }}: poziom zaawansowany wróć do spisu treści

{% endif %} diff --git a/curriculum/templatetags/curriculum_tags.py b/curriculum/templatetags/curriculum_tags.py index cf0cc7d..986271c 100755 --- a/curriculum/templatetags/curriculum_tags.py +++ b/curriculum/templatetags/curriculum_tags.py @@ -60,6 +60,7 @@ def course_box(course): lessons[lesson.level][lesson.type] = [] lessons[lesson.level][lesson.type].append(lesson) return { + "course": course, "lessons": lessons, } diff --git a/edumed/contact_forms.py b/edumed/contact_forms.py index da669e4..89e5121 100644 --- a/edumed/contact_forms.py +++ b/edumed/contact_forms.py @@ -19,9 +19,20 @@ class CooperateForm(ContactForm): form_title = u"Bądź z nami w kontakcie" admin_list = ['podpis', 'contact'] + podpis = forms.CharField(label=u'Imię i nazwisko', max_length=128) contact = forms.EmailField(label=u'E-mail', max_length=128) - podpis = forms.CharField(label=u'Podpis', max_length=128) + instytucja = forms.CharField(label=u'Instytucja (nazwa, adres)', + widget=forms.Textarea, max_length=1000, required=False) uwagi = forms.CharField(label=u'Uwagi', widget=forms.Textarea, max_length=1800, required=False) + + zajecia_przedszkole = forms.BooleanField(label=u'Prowadzę zajęcia z dziećmi w wieku przedszkolnym', required=False) + zajecia_sp13 = forms.BooleanField(label=u'Prowadzę zajęcia z dziećmi z SP kl. 1-3', required=False) + zajecia_sp46 = forms.BooleanField(label=u'Prowadzę zajęcia z dziećmi z SP kl. 4-6', required=False) + zajecia_gimnazjum = forms.BooleanField(label=u'Prowadzę zajęcia z młodzieżą w wieku gimnazjalnym', required=False) + zajecia_ponadgimnazjalne = forms.BooleanField(label=u'Prowadzę zajęcia z młodzieżą ze szkół ponadgimnazjalnych', required=False) + zajecia_wyzsze = forms.BooleanField(label=u'Prowadzę zajęcia w szkole wyższej', required=False) + zajecia_dorosli = forms.BooleanField(label=u'Prowadzę zajęcia dla dorosłych', required=False) + zajecia_seniorzy = forms.BooleanField(label=u'Prowadzę zajęcia dla seniorów', required=False) class ContestForm(ContactForm): -- 2.20.1