From 2cc2b8e1023c1d8ff83a2c5b7998a93ba32e96fa Mon Sep 17 00:00:00 2001 From: filakx Date: Tue, 4 Jun 2019 14:20:32 +0200 Subject: [PATCH] Version 1.3.1 Filters cleanup --- flask-app/mtw/flask.py | 6 +++--- flask-app/mtw/templates/snips/filters.html | 20 ++++++++++--------- .../mtw/templates/sparql/tree-browse.sparql | 3 ++- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/flask-app/mtw/flask.py b/flask-app/mtw/flask.py index 49271f1..8f7c797 100644 --- a/flask-app/mtw/flask.py +++ b/flask-app/mtw/flask.py @@ -46,7 +46,7 @@ def __call__(self, environ, start_response): app.config.update(dict( APP_NAME = 'MTW', - APP_VER = '1.3.0', + APP_VER = '1.3.1', API_VER = '1.0.0', APP_URL = '/mtw', DEFAULT_THEME = 'slate', @@ -942,7 +942,7 @@ def browse(top, tn, action): if request.args.get('show'): show = request.args.get('show').strip() - if show in ('all','translated','todo','scn','ntx'): + if show in ('all','translated','todo','scn','ntx','notpref'): session['show'] = show if request.args.get('status'): @@ -1000,7 +1000,7 @@ def search(dui, action): if request.args.get('show'): show = request.args.get('show').strip() - if show in ('all','translated','todo','scn','ntx'): + if show in ('all','translated','todo','scn','ntx','notpref'): session['sshow'] = show if request.args.get('status'): diff --git a/flask-app/mtw/templates/snips/filters.html b/flask-app/mtw/templates/snips/filters.html index 3fd4e51..a7d256b 100644 --- a/flask-app/mtw/templates/snips/filters.html +++ b/flask-app/mtw/templates/snips/filters.html @@ -6,6 +6,8 @@ {% set SCN_CHECKED = 'checked' %} {% elif show == 'ntx' %} {% set NTX_CHECKED = 'checked' %} + {% elif show == 'notpref' %} + {% set NOTPREF_CHECKED = 'checked' %} {% else %} {% set ALL_CHECKED = 'checked' %} {% endif %} @@ -17,19 +19,19 @@
- -
+ +
- -
+ +
- +
- +
@@ -42,7 +44,7 @@ {% elif status == 'deleted' %} {% set DELETED_STATUS = 'checked' %} {% elif status == 'notpref' %} - {% set NOTPREF_STATUS = 'checked' %} + {% set NOTPREF_STATUS = 'checked' %} {% else %} {% set ALL_STATUS = 'checked' %} {% endif %} @@ -70,8 +72,8 @@
- -
+ + diff --git a/flask-app/mtw/templates/sparql/tree-browse.sparql b/flask-app/mtw/templates/sparql/tree-browse.sparql index c623877..cb2433e 100644 --- a/flask-app/mtw/templates/sparql/tree-browse.sparql +++ b/flask-app/mtw/templates/sparql/tree-browse.sparql @@ -89,6 +89,7 @@ SELECT distinct ?tn ?label ?d ?type ?val ?active ?scn ?scnt ?ntx ?lockedBy { OPTIONAL {?c meshv:scopeNote ?scnv . BIND('YES' as ?scn) } + OPTIONAL {?c mesht:scopeNote ?scntv BIND('YES' as ?scnt) } @@ -103,7 +104,7 @@ SELECT distinct ?tn ?label ?d ?type ?val ?active ?scn ?scnt ?ntx ?lockedBy { FILTER( ?dateCrt >= "{{ config.CREATED_AFTER }}"^^xsd:date ) {% endif %} - {% if status == 'notpref' %} + {% if show == 'notpref' or status == 'notpref' %} ?d meshv:concept ?npc . OPTIONAL { ?npc mesht:preferredTerm ?termIDnp } FILTER (!BOUND(?termIDnp)) ## NotTranslated notPreferred