Skip to content

Commit

Permalink
Version 1.3.1
Browse files Browse the repository at this point in the history
Filters cleanup
  • Loading branch information
filak committed Jun 4, 2019
1 parent 0da2bbc commit 2cc2b8e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
6 changes: 3 additions & 3 deletions flask-app/mtw/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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'):
Expand Down Expand Up @@ -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'):
Expand Down
20 changes: 11 additions & 9 deletions flask-app/mtw/templates/snips/filters.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -17,19 +19,19 @@
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="radioShowTodo" name="show" value="todo" class="custom-control-input" {{ TODO_CHECKED }}>
<label class="custom-control-label" for="radioShowTodo">ToDo</label>
</div>
<label class="custom-control-label" for="radioShowTodo" title="PrefConcepts without translated preferred term">ToDo</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="radioShowTranslated" name="show" value="translated" class="custom-control-input" {{ OK_CHECKED }}>
<label class="custom-control-label text-success" for="radioShowTranslated">Translated</label>
</div>
<label class="custom-control-label text-success" for="radioShowTranslated" title="PrefConcepts with translated preferred term">Translated</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="radioShowScopeNote" name="show" value="scn" class="custom-control-input" {{ SCN_CHECKED }}>
<label class="custom-control-label text-info" for="radioShowScopeNote" title="Missing translated ScopeNote">ScopeNote</label>
<label class="custom-control-label text-info" for="radioShowScopeNote" title="Translated PrefConcepts without translated ScopeNote">ScopeNote</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="radioShowNotTranslatable" name="show" value="ntx" class="custom-control-input" {{ NTX_CHECKED }}>
<label class="custom-control-label text-warning" for="radioShowNotTranslatable" title="NotTranslatable concepts only">NotTranslatable</label>
<label class="custom-control-label text-warning" for="radioShowNotTranslatable" title="Not translatable concepts">NotTranslatable</label>
</div>
</div>

Expand All @@ -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 %}
Expand Down Expand Up @@ -70,8 +72,8 @@
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="radioStatusNotPref" name="status" value="notpref" class="custom-control-input" {{ NOTPREF_STATUS }}>
<label class="custom-control-label" for="radioStatusNotPref" title="NotPreferred concepts only">NotPref</label>
</div>
<label class="custom-control-label" for="radioStatusNotPref" title="NonPrefConcepts without translated preferred term">NotPref</label>
</div>
</div>


3 changes: 2 additions & 1 deletion flask-app/mtw/templates/sparql/tree-browse.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
Expand Down

0 comments on commit 2cc2b8e

Please sign in to comment.