Merge WTEM support into master
[edumed.git] / catalogue / templates / catalogue / snippets / section_box.html
index a931776..c505c04 100755 (executable)
@@ -1,22 +1,52 @@
-{% for level, depths in lessons.items %}
-<section class="section-level section-level-{{ level.slug }}">
+{% load thumbnail %}
+{% for level, types in lessons.items %}
+{% if level.slug == "liceum" %}
+    <p><strong>{{section.title}}</strong>: poziom zaawansowany
+        <span class="section-links"><a href="#top">wróć do spisu treści</a></span>
+    </p>
+{% endif %}
+<section id="{{ section.slug }}_{{ level.slug }}" class="section-level section-level-{{ level.slug }}">
     {% spaceless %}
-    {% for depth, lesson_list in depths.items %}
-        <section class="section-depth section-depth-{{ depth }}">
-            {% if depth == 0 %}
+    <div class='sections-row'>
+    {% for lesson_type, lesson_list in types.items %}
+        {% if lesson_type == 'project' %}
+            </div><div class='sections-row'>
+        {% endif %}
+        <section class="section-type section-type-{{ lesson_type }}">
+            {% if lesson_type == 'synthetic' %}
+                {% if section.image %}
+                    {% thumbnail section.image "120x160" as im %}
+                        <a class="image" href="{{ section.image.url }}">
+                            <img src="{{ im.url }}" />
+                        </a>
+                    {% endthumbnail %}
+                {% endif %}
                 <h1>Lekcja syntetyczna</h1>
+            {% elif lesson_type == 'project' %}
+                <h1>Projekt</h1>
             {% else %}
                 <h1>Pełny kurs</h1>
             {% endif %}
-            <ul class="section-lessons">
+            {% if lesson_list %}
+            <ul class="section-lessons link-list">
                 {% for lesson in lesson_list %}
                     <li class="section-lesson">
-                        <a href="{{ lesson.get_absolute_url }}">{{ lesson }}</a>
+                        {% if lesson.slug %}
+                            <a href="{{ lesson.get_absolute_url }}">{{ lesson }}{% if lesson_type == 'synthetic' %}
+                                <br/>(przegląd całego tematu w 45 minut)
+                            {% endif %}</a>
+                        {% else %}
+                            {{ lesson }} <em>(w&nbsp;przygotowaniu)</em>
+                        {% endif %}
                     </li>
                 {% endfor %}
             </ul>
+            {% else %}
+                <p>(W przygotowaniu)</p>
+            {% endif %}
         </section>
     {% endfor %}
+    </div>
     {% endspaceless %}
 </section>
 {% endfor %}