Fix things + memorisation interface_mode

This commit is contained in:
Evarin 2018-12-26 19:39:34 +01:00
parent f9f62bd1b6
commit e9af6f5cfd
3 changed files with 8 additions and 2 deletions

View file

@ -15,7 +15,9 @@ function InterfaceRecherche(STATIC_ROOT, API_LIEU, ITEMS_URL, lieux) {
function initInterface() {
main_container = $("body");
if (main_container.hasClass("vue-liste")) {
if (sessionStorage && sessionStorage.interface_mode) {
interface_mode = sessionStorage.interface_mode;
} else if (main_container.hasClass("vue-liste")) {
interface_mode = "liste";
} else if (main_container.hasClass("vue-carte")) {
interface_mode = "carte";
@ -67,6 +69,9 @@ function InterfaceRecherche(STATIC_ROOT, API_LIEU, ITEMS_URL, lieux) {
interface_mode = mode;
main_container.removeClass("vue-carte vue-hybride vue-liste")
.addClass("vue-"+mode);
if (sessionStorage) {
sessionStorage.interface_mode = mode;
}
if (mode=="hybride" || mode=="carte") {
initCarte();
map.invalidateSize();

View file

@ -3,7 +3,7 @@
{% block title %}Chercher un stage - ExperiENS{% endblock %}
{% block extra_content_class %}recherche{% endblock %}
{% block bodyclass %}recherche{% endblock %}
{% block content %}
<h1>Chercher un stage</h1>

View file

@ -66,6 +66,7 @@ TEMPLATES = [
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.template.context_processors.request',
'django.contrib.messages.context_processors.messages',
],
},