From e562e7c816a3cf5f85a3d495771523a3ed992a5b Mon Sep 17 00:00:00 2001 From: DUCHATEAU FABIEN <fabien.duchateau@univ-lyon1.fr> Date: Thu, 27 Jun 2019 16:49:16 +0200 Subject: [PATCH] minor corrections (zoom level locked by default, check for Mongo connection + flash message) --- mapiris/main.py | 3 ++- mapiris/model.py | 1 - mapiris/templates/form.html | 4 ++-- setup.cfg | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mapiris/main.py b/mapiris/main.py index 3915c45..229874c 100644 --- a/mapiris/main.py +++ b/mapiris/main.py @@ -15,8 +15,9 @@ url = 'http://127.0.0.1:8081' @app.route('/', defaults={'page': None}) -#@app.route('/<page>', methods=["GET", "POST"]) def index(page): + if not model.db.connection_status: # if no connection, display a flashing message + flash("Could not connect to the MongoDB database ! Check the connection.", "danger") return render_template('index.html') diff --git a/mapiris/model.py b/mapiris/model.py index cc20818..47cd89c 100644 --- a/mapiris/model.py +++ b/mapiris/model.py @@ -11,7 +11,6 @@ import json # connection to the IRIS collection in MongoDB db = Mongiris() iris_collection = db.collection_iris -db.init_connection() json_iris_indicator_code_to_label = 'static/data/dictionnaire-indicateurs.json' diff --git a/mapiris/templates/form.html b/mapiris/templates/form.html index 9f4d719..87656c2 100644 --- a/mapiris/templates/form.html +++ b/mapiris/templates/form.html @@ -5,9 +5,9 @@ <div class="input-group mb-4"> <div class="input-group-prepend"> <button class="btn" type="button" id="boutonEnableDisableZoom"> - <img src="{{url_for('static', filename='css/open-iconic-master/svg/lock-unlocked.svg')}}" width="16" height="16" alt="Enable/Disable" /> + <img src="{{url_for('static', filename='css/open-iconic-master/svg/lock-locked.svg')}}" width="16" height="16" alt="Enable/Disable" /> </button> - <input type="number" min="12" max="18" value="16" maxlength="1" id="inputZoomLevel" style="width: 3em;" /> + <input type="number" min="12" max="18" value="16" disabled maxlength="1" id="inputZoomLevel" style="width: 3em;" /> <span valign="bottom" class="ml-2 pt-1"> (niveau de zoom actuel = <span id="spanZoomLevel" style="font-weight: bold;">6</span>) </span> diff --git a/setup.cfg b/setup.cfg index ad4581b..cb8c5f6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = mapiris -version = 0.12 +version = 0.13 description = This package aims at searching and printing IRIS on a map. author = Fabien Duchateau author_email = fabien.duchateau@univ-lyon1.fr -- GitLab