Skip to content
Snippets Groups Projects
Commit 4d963f87 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 22ded6a9 3ec3193f
No related branches found
No related tags found
1 merge request!86Merge school-apps
......@@ -177,13 +177,20 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
DBSETTINGS_USE_CACHE = not DEBUG
# Cache configs (only on production)
if not DEBUG:
TEST_MEMCACHE = False
if not DEBUG or TEST_MEMCACHE:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
else:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
# PWA
PWA_APP_NAME = 'SchoolApps'
......
......@@ -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