diff --git a/mapiris/main.py b/mapiris/main.py index 3915c4561979a4a0a808494faf8dec7eeef63978..229874c83ab04350965717162828da234fe2f43e 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 cc208184642efe8856138dd7cd21165df8ea8f83..47cd89ca569300511ae641ea01bd99cf1cd901d1 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 9f4d7190cb2c3af0f1de57d27ccdee646e07abe3..87656c2800e4b5f44250a7a6912e497f4b1de01e 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 ad4581beb5e9746825aa800d67970a8240d20df6..cb8c5f60b5c27e8a15be0716ecf0e0f9e6f2e070 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