diff --git a/spatial/templates/spatial/index.html b/spatial/templates/spatial/index.html index b8f9dec5b0ebe928c1923c596c950d6190b0d37d..652a0b4cb4b3e7fd2c8edff2777f9d64410504d7 100644 --- a/spatial/templates/spatial/index.html +++ b/spatial/templates/spatial/index.html @@ -31,7 +31,7 @@ {% if available_grid_models|length > 0 %} <ul> {% for model in available_grid_models %} - <li><a href="gridmap/{{model.model_id}}/">{{ get_text_i18n model.model_name }}</a></li> + <li><a href="gridmap/{{model.model_id}}/">{% get_text_i18n model.model_name %}</a></li> {% endfor %} </ul> {% else %} diff --git a/spatial/views.py b/spatial/views.py index dd733a0b9babbc0121a349547986c15b14b0edbe..9b04a6b8bc6f11eba8c2e82b85be21f63cb51157 100644 --- a/spatial/views.py +++ b/spatial/views.py @@ -3,16 +3,14 @@ from django.http import Http404 from django.conf import settings +# Fallback view - only displaying info for user to move on def index(request): context = { "available_grid_models": settings.AVAILABLE_GRID_MODELS if hasattr(settings, "AVAILABLE_GRID_MODELS") else [] } return render(request, 'spatial/index.html', context) -def psilartemp(request): - context = {} - return render(request, 'spatial/psilartemp.html', context) - +# The main view. Expects a valid model_id, otherwise it defaults to index def gridmap(request, model_id=None): try: for model in settings.AVAILABLE_GRID_MODELS: @@ -22,4 +20,11 @@ def gridmap(request, model_id=None): except AttributeError: pass return redirect("../") + + +# TO BE REMOVED when the PSILARTEMP model has been harmonized with the VIPS gridded model format +def psilartemp(request): + context = {} + return render(request, 'spatial/psilartemp.html', context) +