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

From friday 15:35 the smart plan shows the next week (issue #271)

parent fa15954d
No related branches found
No related tags found
No related merge requests found
......@@ -127,32 +127,32 @@
<div class="col s2">
</div>
{# Show short weekdays on tablets #}
{# Show short weekdays on tablets #}
{% for day in short_week_days %}
<div class="col s2 hide-on-large-only">
<div class="card timetable-title-card">
<div class="card-content">
<span class="card-title">
{{ day.0 }}
</span>
{% if day.1 %}
<span class="badge new blue center-align holiday-badge">{{ day.1.0 }}</span>
{% endif %}
<span class="card-title">
{{ day.0 }}
</span>
{% if day.1 %}
<span class="badge new blue center-align holiday-badge">{{ day.1.0 }}</span>
{% endif %}
</div>
</div>
</div>
{% endfor %}
{# Show long weekdays elsewere #}
{# Show long weekdays elsewere #}
{% for day in long_week_days %}
<div class="col s2 hide-on-med-only">
<div class="card timetable-title-card">
<div class="card-content">
<span class="card-title">
{{ day.0.0 }}
</span>
{% if day.1 %}
<span class="badge new blue center-align holiday-badge">{{ day.1.0 }}</span>
{% endif %}
<span class="card-title">
{{ day.0.0 }}
</span>
{% if day.1 %}
<span class="badge new blue center-align holiday-badge">{{ day.1.0 }}</span>
{% endif %}
</div>
</div>
</div>
......
......@@ -125,8 +125,7 @@ def quicklaunch(request):
@login_required
@permission_required("timetable.show_plan")
def plan(request, plan_type, plan_id, regular="", year=timezone.datetime.now().year,
calendar_week=timezone.datetime.now().isocalendar()[1]):
def plan(request, plan_type, plan_id, regular="", year=None, calendar_week=None):
"""
[DJANGO VIEW]
Show a timetable (class, teacher, room, smart/regular)
......@@ -138,6 +137,10 @@ def plan(request, plan_type, plan_id, regular="", year=timezone.datetime.now().y
:param calendar_week: calendar week in year (only for smart plan)
:return:
"""
if year is None or calendar_week is None:
date = get_next_weekday_with_time(timezone.datetime.now(), timezone.datetime.now().time())
year = date.year
calendar_week = date.isocalendar()[1]
# Regular or smart plan?
if regular == "regular":
......
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