From: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Date: Thu, 20 Jun 2013 12:17:14 +0000 (+0200)
Subject: Various minor changes
X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/4a5465903e5c24822b1d9f68c69f71b5daf4bc45?hp=29e4768fe8e16fad199f7b3fe7dcef6da0c4ea56

Various minor changes
---

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 @@
     </li>
 {% endfor %}
 </ul>
+
+{% with other=lesson.get_other_level %}
+    {% if other %}
+        <p>Ten temat jest dostępny również na 
+        <a href="{% url 'catalogue_lessons' %}#{{ lesson.section.slug }}_{{ other.slug }}">poziomie
+        {% if other.slug == 'liceum' %}zaawansowanym{% else %}podstawowym{% endif %}</a>.</p>
+    {% 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" %}
-    <p>Poziom zaawansowany
+    <p><strong>{{section.title}}</strong>: poziom zaawansowany
         <span class="section-links"><a href="#top">wróć do spisu treści</a></span>
     </p>
 {% endif %}
-<section class="section-level section-level-{{ level.slug }}">
+<section id="{{ section.slug }}_{{ level.slug }}" class="section-level section-level-{{ level.slug }}">
     {% spaceless %}
     {% for lesson_type, lesson_list in types.items %}
         <section class="section-type section-type-{{ lesson_type }}">
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" %}
-    <p>Poziom zaawansowany
+    <p><strong>{{ course }}</strong>: poziom zaawansowany
         <span class="section-links"><a href="#top">wróć do spisu treści</a></span>
     </p>
 {% 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):