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

Last bugs

parent d7a2bfb8
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@
</div>
{# <h5>{{ date|date:"l, j. F Y" }}</h5>#}
<div class="row">
<div class="timetable-plan col s12 m6">
<div class="timetable-plan col s12 m12 l6">
{# Week days #}
<div class="row">
......
{% include 'partials/header.html' %}
<script type="text/javascript">
function updateDatepicker() {
$("#date").val(formatDate(activeDate));
}
function update() {
console.log("Render new.");
updateDatepicker();
}
function loadNew() {
window.location.href = "/timetable/substitutions/" + formatDateForDjango(activeDate);
}
function onDateBeforeClick() {
activeDate.setDate(activeDate.getDate() - 1);
update();
loadNew();
}
function onDateNextClick() {
activeDate.setDate(activeDate.getDate() + 1);
update();
loadNew();
}
function onDateChanged() {
var str = $("#date").val();
var split = str.split(".")
activeDate = new Date(split[2], split[1] - 1, split[0]);
update();
loadNew();
}
var activeDate = new Date({{ date_js }});
$(document).ready(function () {
$("#date-before").click(onDateBeforeClick);
$("#date-next").click(onDateNextClick);
$("#date").change(onDateChanged);
update();
})
<script type="text/javascript">
var dest = "/timetable/substitutions/";
</script>
<main>
......@@ -51,20 +10,7 @@
<div class="row no-print">
<div class="col s12 m6 l4 xl3">
<div class="col s2">
<a class="waves-effect waves-teal btn-flat btn-flat-medium right" id="date-before">
<i class="material-icons center">navigate_before</i>
</a>
</div>
<div class="col s8">
<input type="text" class="datepicker center-align" id="date">
</div>
<div class="col s2">
<a class="waves-effect waves-teal btn-flat btn-flat-medium left" id="date-next">
<i class="material-icons center">navigate_next</i>
</a>
</div>
{% include "timetable/datepicker.html" %}
</div>
<div class="col l4 xl6">
</div>
......
......@@ -85,7 +85,7 @@ def plan(request, plan_type, plan_id, smart="", year=timezone.datetime.now().yea
smart = False
monday_of_week = get_calendar_week(calendar_week, year)["first_day"]
print(monday_of_week)
# print(monday_of_week)
if plan_type == 'teacher':
_type = TYPE_TEACHER
......@@ -136,16 +136,16 @@ def my_plan(request, year=None, day=None, month=None):
shortcode = request.user.username
el = get_teacher_by_shortcode(shortcode)
plan_id = el.id
print(el)
# print(el)
elif _type == UserInformation.STUDENT:
_type = TYPE_CLASS
_name = UserInformation.user_classes(request.user)[0]
print(_name)
# print(_name)
el = get_class_by_name(_name)
plan_id = el.id
else:
redirect("timetable_admin_all")
print(monday_of_week)
# print(monday_of_week)
plan = get_plan(_type, plan_id, smart=True, monday_of_week=monday_of_week)
# print(parse_lesson_times())
......@@ -161,7 +161,7 @@ def my_plan(request, year=None, day=None, month=None):
"date": date,
"date_js": int(date.timestamp()) * 1000
}
print(context["week_day"])
# print(context["week_day"])
return render(request, 'timetable/myplan.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