From 65f1d42cc91a6293b1200d167ba08050bf72627c Mon Sep 17 00:00:00 2001
From: Tom Teichler <tom.teichler@teckids.org>
Date: Sat, 4 Jan 2020 15:35:05 +0100
Subject: [PATCH] Fix templates.

---
 .../apps/chronos/templates/timetable/all.html | 14 +++---
 .../chronos/templates/timetable/fallback.html | 10 ++--
 .../chronos/templates/timetable/hintform.html | 46 ++++++++++---------
 .../chronos/templates/timetable/hints.html    | 10 ++--
 .../chronos/templates/timetable/myplan.html   |  8 ++--
 .../chronos/templates/timetable/plan.html     |  8 ++--
 .../templates/timetable/quicklaunch.html      |  8 ++--
 .../templates/timetable/substitution.html     |  8 ++--
 .../timetable/substitutionprint.html          |  9 ++--
 9 files changed, 60 insertions(+), 61 deletions(-)

diff --git a/aleksis/apps/chronos/templates/timetable/all.html b/aleksis/apps/chronos/templates/timetable/all.html
index ce5cc999..443394be 100644
--- a/aleksis/apps/chronos/templates/timetable/all.html
+++ b/aleksis/apps/chronos/templates/timetable/all.html
@@ -1,14 +1,14 @@
-{% include 'partials/header.html' %}
+{% extends 'core/base.html' %}
 
-<main>
-    <h3>Alle Pläne</h3>
+{% block content %}
+    <h3>{% blocktrans %}All timetables{% endblocktrans %}</h3>
     <div class="row">
         <div class="col s12 m4">
             <h4>Lehrkräfte</h4>
             <ul class="collection">
                 {% for teacher in teachers %}
                     <li class="collection-item avatar">
-                        <i class="circle">{{ teacher.shortcode }}</i><!-- Shortcode -->
+                        <i class="circle">{{ teacher. }}</i>
                         <a href="{% url 'timetable_smart_plan' 'teacher' teacher.id %}">{{ teacher.first_name }}
                             <strong>{{ teacher.name }}</strong></a>
                     </li>
@@ -33,7 +33,7 @@
         </div>
 
         <div class="col s12 m4">
-            <h4>Räume</h4>
+            <h4>{% blocktrans %}Rooms{% endblocktrans %}</h4>
             <ul class="collection">
                 {% for room in rooms %}
                     <li class="collection-item avatar">
@@ -47,6 +47,6 @@
 
     </div>
 
-</main>
+{% endblock %}
+
 
-{% include 'partials/footer.html' %}
diff --git a/aleksis/apps/chronos/templates/timetable/fallback.html b/aleksis/apps/chronos/templates/timetable/fallback.html
index b68dbeed..b0fb65a2 100644
--- a/aleksis/apps/chronos/templates/timetable/fallback.html
+++ b/aleksis/apps/chronos/templates/timetable/fallback.html
@@ -1,8 +1,6 @@
-{% include 'partials/header.html' %}
+{% extends 'core/base.html' %}
 
-<main>
-    <h3>Die Stundenpläne sind aktuell noch nicht einsehbar.</h3>
+{% block content %}
+    <h3>{% blocktrans %}The timetables are currently unavailable.{% endblocktrans %}</h3>
 
-</main>
-
-{% include 'partials/footer.html' %}
+{% endblock %}
diff --git a/aleksis/apps/chronos/templates/timetable/hintform.html b/aleksis/apps/chronos/templates/timetable/hintform.html
index 60593e9a..9484361a 100644
--- a/aleksis/apps/chronos/templates/timetable/hintform.html
+++ b/aleksis/apps/chronos/templates/timetable/hintform.html
@@ -1,15 +1,17 @@
-{% include 'partials/header.html' %}
-{% load material_form %}
-{% load martortags %}
-{% load static %}
-{% load widget_tweaks %}
+{% extends 'core/base.html' %}
+{% load material_form martortags static widget_tweaks %}
 
-<main>
+
+{% block content %}
     <h4>
         {% if mode == "new" %}
-            Neuen Hinweis erstellen
+            {% blocktrans %}
+                Create hint
+            {% endblocktrans %}
         {% else %}
-            Hinweis bearbeiten
+            {% blocktrans %}
+                Hinweis bearbeiten
+            {% endblocktrans %}
         {% endif %}
     </h4>
 
@@ -17,13 +19,13 @@
         <div class="alert success">
             <p>
                 <i class="material-icons left">check_circle</i>
-                Der Hinweis wurde erfolgreich erstellt und veröffentlicht. Weiteren Hinweis anlegen oder zur Übersicht
-                zurück?<br>
+                {% blocktrans %}Der Hinweis wurde erfolgreich erstellt und veröffentlicht. Weiteren Hinweis anlegen oder zur Übersicht
+                zurück?{% endblocktrans %}<br>
                 <a class="btn waves-effect waves-light" href="{% url "timetable_hints" %}"><i
-                        class="material-icons left">arrow_back</i> Zurück zur Übersicht
+                        class="material-icons left">arrow_back</i>{% blocktrans %}Back to overview{% endblocktrans %}
                 </a>
                 <a class="btn waves-effect waves-light green" href="#add-hint"><i class="material-icons left">add</i>
-                    Weiteren Hinweis hinzufügen
+                    {% blocktrans %}Create antoher hint{% endblocktrans %}
                 </a>
             </p>
         </div>
@@ -39,7 +41,7 @@
                 </div>
             </div>
         {% endif %}
-        <h5>Über welchen Zeitraum soll der Hinweis angezeigt werden?
+        <h5>{% blocktrans %}Über welchen Zeitraum soll der Hinweis angezeigt werden?{% blocktrans %}
             <span class="red-text">*</span>
         </h5>
 
@@ -69,7 +71,7 @@
                 {{ form.to_date|add_class:"datepicker required" }}
             </div>
         </div>
-        <h5>Für wen soll der Hinweis angezeigt werden?
+        <h5>{% blocktrans %}Für wen soll der Hinweis angezeigt werden?{% endblocktrans %}
             <span class="red-text">*</span>
         </h5>
 
@@ -83,9 +85,9 @@
         {% endif %}
         {{ form.classes.label_tag }}
         {{ form.classes }}
-        <a href="#" id="select-all-classes">Alle auswählen</a>
+        <a href="#" id="select-all-classes">{% blocktrans %}Alle auswählen{% endblocktrans %}</a>
         ·
-        <a href="#" id="deselect-all-classes">Alle abwählen</a>
+        <a href="#" id="deselect-all-classes">{% blocktrans %}Alle abwählen{% endblocktrans %}</a>
         <script type="text/javascript">
             $("#select-all-classes").click(function () {
                 $(".select-wrapper ul li:not(.selected)").click();
@@ -106,11 +108,11 @@
         <p>
             <label>
                 {{ form.teachers }}
-                <span>Für Lehrer anzeigen?</span>
+                <span>{% blocktrans %}Für Lehrer anzeigen?{% endblocktrans %}</span>
             </label>
         </p>
 
-        <h5>Hinweistext
+        <h5>{% blocktrans %}Hinweistext{% endblocktrans %}
             <span class="red-text">*</span>
         </h5>
         {% if form.text.errors %}
@@ -125,8 +127,8 @@
 
 
         <button type="submit" class="waves-effect waves-light btn green">
-            <i class="material-icons left">save</i> Hinweis {% if mode == "new" %} erstellen und
-            veröffentlichen {% else %} aktualisieren {% endif %}
+            <i class="material-icons left">save</i>{% blocktrans %} Hinweis {% if mode == "new" %} erstellen und
+            veröffentlichen {% else %} aktualisieren {% endif %}{% endblocktrans %}
         </button>
     </form>
 
@@ -137,6 +139,6 @@
     <script type="text/javascript" src="{% static 'plugins/js/highlight.min.js' %}"></script>
     <script type="text/javascript" src="{% static 'plugins/js/resizable.min.js' %}"></script>
     <script type="text/javascript" src="{% static 'martor/js/martor.min.js' %}"></script>
-</main>
+{% endblock %}
+
 
-{% include 'partials/footer.html' %}
diff --git a/aleksis/apps/chronos/templates/timetable/hints.html b/aleksis/apps/chronos/templates/timetable/hints.html
index bd289497..5e605470 100644
--- a/aleksis/apps/chronos/templates/timetable/hints.html
+++ b/aleksis/apps/chronos/templates/timetable/hints.html
@@ -1,9 +1,9 @@
-{% include 'partials/header.html' %}
+{% extends 'core/base.html' %}
 {% load material_form %}
 {% load martortags %}
 
-<main>
-    <h4>Hinweismanagement</h4>
+{% block content %}
+    <h4>{% blocktrans %}Hinweismanagement{% endblocktrans %}</h4>
 
     {% if msg %}
         <div class="alert success">
@@ -80,6 +80,6 @@
             </li>
         {% endfor %}
     </ul>
-</main>
+{% endblock %}
+
 
-{% include 'partials/footer.html' %}
diff --git a/aleksis/apps/chronos/templates/timetable/myplan.html b/aleksis/apps/chronos/templates/timetable/myplan.html
index 49385ff6..bf8c9d17 100644
--- a/aleksis/apps/chronos/templates/timetable/myplan.html
+++ b/aleksis/apps/chronos/templates/timetable/myplan.html
@@ -1,7 +1,7 @@
-{% include 'partials/header.html' %}
+{% extends 'core/base.html' %}
 
 
-<main>
+{% block content %}
     <div class="row nomargin">
         <div class="col m12 s12 l6">
             <h4>
@@ -77,6 +77,6 @@
 
         </div>
     </div>
-</main>
+{% endblock %}
+
 
-{% include 'partials/footer.html' %}
diff --git a/aleksis/apps/chronos/templates/timetable/plan.html b/aleksis/apps/chronos/templates/timetable/plan.html
index 88e6e30a..6cc88295 100644
--- a/aleksis/apps/chronos/templates/timetable/plan.html
+++ b/aleksis/apps/chronos/templates/timetable/plan.html
@@ -1,4 +1,4 @@
-{% include 'partials/header.html' %}
+{% extends 'core/base.html' %}
 {% load copy_filter %}
 <script type="text/javascript">
     {% if smart %}
@@ -42,7 +42,7 @@
         });
     {% endif %}
 </script>
-<main>
+{% block content %}
     <div class="row no-margin">
         <div class="col s8 m6 l8 xl9">
             <h3>
@@ -257,6 +257,6 @@
             {% endfor %}
         {% endfor %}
     </div>
-</main>
+{% endblock %}
+
 
-{% include 'partials/footer.html' %}
diff --git a/aleksis/apps/chronos/templates/timetable/quicklaunch.html b/aleksis/apps/chronos/templates/timetable/quicklaunch.html
index 2647f44c..2d2215ce 100644
--- a/aleksis/apps/chronos/templates/timetable/quicklaunch.html
+++ b/aleksis/apps/chronos/templates/timetable/quicklaunch.html
@@ -1,6 +1,6 @@
-{% include 'partials/header.html' %}
+{% extends 'core/base.html' %}
 
-<main>
+{% block content %}
     <h4>Alle Pläne</h4>
     <div class="row">
         <div class="col s12 m4">
@@ -38,6 +38,6 @@
 
     </div>
 
-</main>
+{% endblock %}
+
 
-{% include 'partials/footer.html' %}
diff --git a/aleksis/apps/chronos/templates/timetable/substitution.html b/aleksis/apps/chronos/templates/timetable/substitution.html
index ca598374..af08ef73 100644
--- a/aleksis/apps/chronos/templates/timetable/substitution.html
+++ b/aleksis/apps/chronos/templates/timetable/substitution.html
@@ -1,11 +1,11 @@
-{% include 'partials/header.html' %}
+{% extends 'core/base.html' %}
 
 
 <script type="text/javascript">
     var dest = "/timetable/substitutions/";
 </script>
 
-<main>
+{% block content %}
     <div class="row no-margin">
         <div class="col s10 m6">
             <h4>Vertretungen</h4>
@@ -107,6 +107,6 @@
         </tbody>
     </table>
 
-</main>
+{% endblock %}
+
 
-{% include 'partials/footer.html' %}
diff --git a/aleksis/apps/chronos/templates/timetable/substitutionprint.html b/aleksis/apps/chronos/templates/timetable/substitutionprint.html
index 39363d68..974fcea9 100644
--- a/aleksis/apps/chronos/templates/timetable/substitutionprint.html
+++ b/aleksis/apps/chronos/templates/timetable/substitutionprint.html
@@ -1,6 +1,7 @@
+{% extends 'core/base.html' %}
 {% load common %}
-{% include 'partials/paper/header.html' %}
 
+{% block content %}
 <script type="text/javascript">
     var dest = "/timetable/substitutions/";
 </script>
@@ -56,7 +57,7 @@
         {% if not c.sub_table %}
             <td colspan="7">
                 <p class="flow-text center">
-                    Keine Vertretungen vorhanden
+                    {% blocktrans %}Keine Vertretungen vorhanden{% endblocktrans %}
                 </p>
             </td>
         {% endif %}
@@ -105,6 +106,4 @@
     </table>
 
 {% endfor %}
-
-
-{% include 'partials/paper/footer.html' %}
+{% endblock %}
-- 
GitLab