diff --git a/schoolapps/schoolapps/settings.py b/schoolapps/schoolapps/settings.py index d6a2219b1b0f2cf7cc374e2db8a14020cb85bda5..36fd54aa760b3c7a73a72754b972a28b659b2241 100755 --- a/schoolapps/schoolapps/settings.py +++ b/schoolapps/schoolapps/settings.py @@ -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' diff --git a/schoolapps/timetable/templates/timetable/plan.html b/schoolapps/timetable/templates/timetable/plan.html index 07a8aeef0fc284bfe37ebff502863a262e5cc49f..88e6e30a42cc90d3546bbe256f115a9e3d6f43f5 100755 --- a/schoolapps/timetable/templates/timetable/plan.html +++ b/schoolapps/timetable/templates/timetable/plan.html @@ -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>