From 9529fa819c3827bb7c2b152ea3a6425304c656b7 Mon Sep 17 00:00:00 2001 From: Ryan Herbert Date: Fri, 9 Feb 2018 18:44:23 +0100 Subject: [PATCH] restyle set autocomplete set autocompletion displays actual tokens that will be inserted --- browser/css/vidjil.less | 15 --------------- browser/js/autocomplete.js | 6 ++++-- .../applications/vidjil/controllers/sample_set.py | 2 +- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/browser/css/vidjil.less b/browser/css/vidjil.less index 9a5f988f9..f0651f209 100644 --- a/browser/css/vidjil.less +++ b/browser/css/vidjil.less @@ -2355,21 +2355,6 @@ form { background: #3366FF; color: white; - &.patient_li { - color: black; - background: @patientTokenColor; - } - - &.run_li { - color: black; - background: @runTokenColor; - } - - &.generic_li { - color: black; - background: @genericTokenColor; - } - small { color: white; } diff --git a/browser/js/autocomplete.js b/browser/js/autocomplete.js index 00aaa620b..e62d00da2 100644 --- a/browser/js/autocomplete.js +++ b/browser/js/autocomplete.js @@ -142,7 +142,8 @@ VidjilAutoComplete.prototype = { return { id: i.id, name: i.name, - search: i.name + search: i.name, + set_type: i.type }; }); return res; @@ -159,9 +160,10 @@ VidjilAutoComplete.prototype = { // encapsulate the string_id's set_type token (:p, :r, :s) within a span li = li.replace(li.substr(4,2), function(str) { - return '' + str + ''; + return '' + str + ''; }); li = li.replace('
  • ', '
  • '); + li = li.replace('
  • ', '
    '); var regexp; if (!query) { return li; diff --git a/server/web2py/applications/vidjil/controllers/sample_set.py b/server/web2py/applications/vidjil/controllers/sample_set.py index 67250493d..6cd1824b3 100644 --- a/server/web2py/applications/vidjil/controllers/sample_set.py +++ b/server/web2py/applications/vidjil/controllers/sample_set.py @@ -771,7 +771,7 @@ def get_sample_set_list(type): helper = factory.get_instance(type=type) for row in query : tmp = helper.get_id_string(row) - ss_list.append({'name':tmp, 'id': row.sample_set_id}) + ss_list.append({'name':tmp, 'id': row.sample_set_id, 'type': type}) return ss_list def auto_complete(): -- GitLab