From e9af6f5cfd8896f38a3f5b06719ac326efbaf175 Mon Sep 17 00:00:00 2001 From: Evarin Date: Wed, 26 Dec 2018 19:39:34 +0100 Subject: [PATCH] Fix things + memorisation interface_mode --- avisstage/static/js/recherche.js | 7 ++++++- avisstage/templates/avisstage/recherche/recherche.html | 2 +- experiENS/settings_base.py | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/avisstage/static/js/recherche.js b/avisstage/static/js/recherche.js index 56e61c4..06a2eaf 100644 --- a/avisstage/static/js/recherche.js +++ b/avisstage/static/js/recherche.js @@ -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(); diff --git a/avisstage/templates/avisstage/recherche/recherche.html b/avisstage/templates/avisstage/recherche/recherche.html index 102bd4d..6400225 100644 --- a/avisstage/templates/avisstage/recherche/recherche.html +++ b/avisstage/templates/avisstage/recherche/recherche.html @@ -3,7 +3,7 @@ {% block title %}Chercher un stage - ExperiENS{% endblock %} -{% block extra_content_class %}recherche{% endblock %} +{% block bodyclass %}recherche{% endblock %} {% block content %}

Chercher un stage

diff --git a/experiENS/settings_base.py b/experiENS/settings_base.py index 40b0332..ca52a5e 100644 --- a/experiENS/settings_base.py +++ b/experiENS/settings_base.py @@ -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', ], },