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

Add lesson times to timetable

parent d9a8730f
No related branches found
No related tags found
No related merge requests found
...@@ -56,14 +56,18 @@ ...@@ -56,14 +56,18 @@
</div> </div>
</div> </div>
{% for row in plan %} {% for row, time in plan %}
<div class="row"> <div class="row">
<div class="col s2"> <div class="col s2">
<div class="card timetable-title-card"> <div class="card timetable-title-card">
<div class="card-content"> <div class="card-content">
<span class="card-title"> <span class="card-title left">
{{ forloop.counter0|add:"+1" }}. {{ time.number_format }}
</span> </span>
<div class="right timetable-time grey-text text-darken-2">
<span>{{ time.start|date:"H:i" }}</span><br>
<span>{{ time.end|date:"H:i" }}</span>
</div>
</div> </div>
</div> </div>
......
import datetime
from django.contrib.auth.decorators import login_required, permission_required from django.contrib.auth.decorators import login_required, permission_required
from django.http import Http404 from django.http import Http404
from django.shortcuts import render from django.shortcuts import render
from django.utils import timezone
from schoolapps.settings import LESSONS
from untisconnect.parse import * from untisconnect.parse import *
try: try:
...@@ -53,11 +58,13 @@ def plan(request, plan_type, plan_id): ...@@ -53,11 +58,13 @@ def plan(request, plan_type, plan_id):
raise Http404('Page not found.') raise Http404('Page not found.')
plan = get_plan(_type, plan_id) plan = get_plan(_type, plan_id)
print(parse_lesson_times())
context = { context = {
"type": _type, "type": _type,
"plan": plan, "plan": plan,
"el": el "el": el,
"times": parse_lesson_times()
} }
return render(request, 'timetable/plan.html', context) return render(request, 'timetable/plan.html', context)
......
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