Skip to content
Snippets Groups Projects
Commit 9267a0e0 authored by Julian's avatar Julian Committed by root
Browse files

Merge pull request #339 from Katharineum/bugfix/plan-select-next-year

Include support for next/last years in plan select 
parents 13ab659f aaf433d4
No related branches found
No related tags found
No related merge requests found
......@@ -3,22 +3,27 @@
<script type="text/javascript">
{% if smart %}
var week = {{ selected_week }};
function goToCalendarWeek(cw) {
window.location.href = "{% url "timetable_smart_plan" raw_type id %}/{{ selected_year }}/" + cw;
var year = {{ selected_year }};
function goToCalendarWeek(cw, year) {
window.location.href = "{% url "timetable_smart_plan" raw_type id %}/" + year + "/" + cw;
}
function onCalendarWeekChanged(where) {
goToCalendarWeek($(where).val());
goToCalendarWeek($(where).val(), year);
}
function weekBefore() {
if (week > 1) {
goToCalendarWeek(week - 1)
goToCalendarWeek(week - 1, year)
} else {
goToCalendarWeek(52, year - 1)
}
}
function weekNext() {
if (week < 52) {
goToCalendarWeek(week + 1);
goToCalendarWeek(week + 1, year);
} else {
goToCalendarWeek(1, year + 1);
}
}
......@@ -51,7 +56,7 @@
<span data-position="bottom" class="tooltipped"
data-tooltip="{{ teacher }}">
<a href="{% url "timetable_smart_plan" "teacher" teacher.id %}">
<a href="{% url "timetable_smart_plan" "teacher" teacher.id %}">
{{ teacher.shortcode }}</a></span>{% if not forloop.last %},{% endif %}
{% endfor %}
</h5>
......
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