diff --git a/schoolapps/timetable/templates/timetable/hintsinplan.html b/schoolapps/timetable/templates/timetable/hintsinplan.html index 0af7d78be55d110c69659afe6435c1081e0a8a8c..9abfc5816740e349d3fddc83b87759b214b89b61 100644 --- a/schoolapps/timetable/templates/timetable/hintsinplan.html +++ b/schoolapps/timetable/templates/timetable/hintsinplan.html @@ -1,11 +1,11 @@ {% load martortags %} {% if hints %} {% for hint in hints %} - <div class="alert primary"> - <div> - <em class="right">Hinweis für {{ hint.from_date|date:"D" }} + <div class="card"> + <div class="card-content light-blue lighten-4"> + <em class="right">Hinweis für {{ hint.from_date|date:"D, d.m." }}, {% if hint.from_date != hint.to_date %} - bis {{ hint.to_date|date:"D" }} + bis {{ hint.to_date|date:"D, d.m." }} {% endif %} </em> <i class="material-icons left">announcement</i> diff --git a/schoolapps/timetable/templates/timetable/substitution.html b/schoolapps/timetable/templates/timetable/substitution.html index ef1010e1ce9b7034a969816e7505a20741a8711d..5b796e623e9d92a7aa886ea96ad1dc260b776e77 100755 --- a/schoolapps/timetable/templates/timetable/substitution.html +++ b/schoolapps/timetable/templates/timetable/substitution.html @@ -36,6 +36,13 @@ </tr> </thead> <tbody> + {% if not sub_table %} + <td colspan="7"> + <p class="flow-text center"> + Keine Vertretungen vorhanden + </p> + </td> + {% endif %} {% for sub in sub_table %} <tr class="{{ sub.color }}-text"> <td> diff --git a/schoolapps/timetable/views.py b/schoolapps/timetable/views.py index 3aee8634e1eb2417294541a5499ac567dedbefdf..0e4327e800e6ef6bf67cb7de45e09aa2fd47cae4 100755 --- a/schoolapps/timetable/views.py +++ b/schoolapps/timetable/views.py @@ -141,7 +141,7 @@ def plan(request, plan_type, plan_id, regular="", year=timezone.datetime.now().y @login_required @permission_required("timetable.show_plan") -def my_plan(request, year=None, day=None, month=None): +def my_plan(request, year=None, month=None, day=None): date = timezone.datetime.now() if year is not None and day is not None and month is not None: date = timezone.datetime(year=year, month=month, day=day) @@ -253,13 +253,18 @@ def sub_pdf(request): @login_required @permission_required("timetable.show_plan") -def substitutions(request, year=None, day=None, month=None): +def substitutions(request, year=None, month=None, day=None): """Show substitutions in a classic view""" date = timezone.datetime.now() if year is not None and day is not None and month is not None: date = timezone.datetime(year=year, month=month, day=day) + # Get next weekday if it is a weekend + next_weekday = get_next_weekday(date) + if next_weekday != date: + return redirect("timetable_substitutions_date", next_weekday.year, next_weekday.month, next_weekday.day) + # Get subs and generate table subs = get_substitutions_by_date(date) sub_table = generate_sub_table(subs)