Skip to content
Snippets Groups Projects
Commit 9cd59f1d authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

- "Keine Vertretungen vorhanden" notice

- Hints as cards
- Skip weekend in subs, too
parent 905ab6f7
No related branches found
No related tags found
1 merge request!86Merge school-apps
{% 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>
......
......@@ -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>
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment