From: Radek Czajka <radekczajka@nowoczesnapolska.org.pl>
Date: Wed, 7 Aug 2013 11:37:17 +0000 (+0200)
Subject: Project list on project page.
X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/3017f6ff905303f7d664d6da40c471c2d86381e3

Project list on project page.
---

diff --git a/catalogue/templates/catalogue/snippets/lesson_nav.html b/catalogue/templates/catalogue/snippets/lesson_nav.html
index fa9d8ad..4e36e22 100755
--- a/catalogue/templates/catalogue/snippets/lesson_nav.html
+++ b/catalogue/templates/catalogue/snippets/lesson_nav.html
@@ -3,6 +3,8 @@
     <a href="{{ root.get_absolute_url }}">{{ root }}</a>
 {% elif lesson.type == 'synthetic' %}
     <a href="{% url 'catalogue_lessons' %}">Lekcje syntetyczne ze wszystkich tematów</a>
+{% elif lesson.type == 'project' %}
+    <a href="{% url 'catalogue_lessons' %}">Projekty ze wszystkich tematów</a>
 {% else %}
     <a href="{% url 'catalogue_lessons' %}">Inne</a>
 {% endif %}
@@ -23,6 +25,7 @@
 {% endfor %}
 </ul>
 
+{% if link_other_level %}
 {% with other=lesson.get_other_level %}
     {% if other %}
         <p>Ten temat jest dostępny również na 
@@ -30,3 +33,4 @@
         {% if other.slug == 'liceum' %}zaawansowanym{% else %}podstawowym{% endif %}</a>.</p>
     {% endif %}
 {% endwith %}
+{% endif %}
diff --git a/catalogue/templatetags/catalogue_tags.py b/catalogue/templatetags/catalogue_tags.py
index 4485e18..a8d69e6 100755
--- a/catalogue/templatetags/catalogue_tags.py
+++ b/catalogue/templatetags/catalogue_tags.py
@@ -49,14 +49,15 @@ def section_box(section):
 
 @register.inclusion_tag("catalogue/snippets/lesson_nav.html")
 def lesson_nav(lesson):
-    if lesson.type in ('course', 'project'):
+    if lesson.type == 'course':
         root = lesson.section
         siblings = Lesson.objects.filter(type='course', level=lesson.level, section=root)
         mark_level = False
+        link_other_level = True
     else:
         root = None
         siblings = Lesson.objects.filter(type=lesson.type)
-        mark_level = True
+        mark_level = link_other_level = lesson.type == 'course'
     return {
         "lesson": lesson,
         "root": root,