From 634fce4ad7badd7b5f7d40cf15c8bf74f9149fe3 Mon Sep 17 00:00:00 2001
From: Frank Poetzsch-Heffter <p-h@katharineum.de>
Date: Fri, 13 Dec 2019 16:54:24 +0100
Subject: [PATCH] teachers in for-loop

---
 .../timetable/templates/timetable/plan.html   | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/schoolapps/timetable/templates/timetable/plan.html b/schoolapps/timetable/templates/timetable/plan.html
index c4570e932..07a8aeef0 100755
--- a/schoolapps/timetable/templates/timetable/plan.html
+++ b/schoolapps/timetable/templates/timetable/plan.html
@@ -47,20 +47,13 @@
             {# Show class teacher and deputy class teacher #}
             {% if type == 2 and el.teachers %}
                 <h5>Klassenlehrkräfte:
-                    <span data-position="bottom" class="tooltipped"
-                          data-tooltip="{{ el.teachers.0 }}">
-                        <a href="{% url "timetable_smart_plan" "teacher" el.teachers.0.id %}">
-                            {{ el.teachers.0.shortcode }}
-                        </a>,
-                    </span>
-                    {% if el.teachers.1 %}
+                    {% for teacher in el.teachers %}
+
                         <span data-position="bottom" class="tooltipped"
-                              data-tooltip="{{ el.teachers.1 }}">
-                            <a href="{% url "timetable_smart_plan" "teacher" el.teachers.1.id %}">
-                                {{ el.teachers.1.shortcode }}
-                            </a>
-                        </span>
-                    {% endif %}
+                              data-tooltip="{{ teacher }}">
+                             <a href="{% url "timetable_smart_plan" "teacher" teacher.id %}">
+                                {{ teacher.shortcode }}</a></span>{% if not forloop.last %},{% endif %}
+                    {% endfor %}
                 </h5>
             {% endif %}
         </div>
-- 
GitLab