Commit 1753759c authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-s/3533-set_tokens_everywhere' into 'dev'

Feature s/3533 set tokens everywhere

Closes #3533

See merge request !323
parents f959661a aceb72df
Pipeline #44807 passed with stages
in 7 minutes and 23 seconds
......@@ -21,7 +21,7 @@ class SampleSet(object):
return data['name']
def get_display_name(self, data):
return self.get_name(data)
return SPAN(self.get_name(data), _class="set_token generic_token")
def get_info(self, data):
return data['info']
......
......@@ -12,7 +12,7 @@ class Generic(SampleSet):
return filter(lambda row : vidjil_utils.advanced_filter(row['string'], filter_str), data)
def get_info_dict(self, data):
return dict(name = "set : %s" % self.get_display_name(data),
return dict(name = self.get_display_name(data),
filename = "sample_set_%d" % data['id'],
label = "",
info = ""
......
......@@ -19,7 +19,7 @@ class Patient(SampleSet):
return vidjil_utils.anon_names(data['sample_set_id'], data['first_name'], data['last_name'], anon)
def get_display_name(self, data, anon=None):
return vidjil_utils.display_names(data.sample_set_id, data.first_name, data.last_name, anon)
return SPAN(vidjil_utils.display_names(data.sample_set_id, data.first_name, data.last_name, anon), _class="set_token patient_token")
def get_birth(self, data):
return "%s" % str(data['birth']) if data['birth'] is not None else ''
......
......@@ -15,6 +15,9 @@ class Run(SampleSet):
def get_name(self, data):
return data['name']
def get_display_name(self, data):
return SPAN(self.get_name(data), _class="set_token run_token")
def get_embellished_name(self, data):
return 'run: %s' % data['name']
......@@ -27,7 +30,7 @@ class Run(SampleSet):
return filter(lambda row : vidjil_utils.advanced_filter(row['string'], filter_str), data)
def get_info_dict(self, data):
return dict(name = "run : " + data['name'] + " (" + str(data['run_date']) + ")",
return dict(name = self.get_display_name(data),
filename = "run : " + data['name'] + "_" + str(data['run_date']),
label = data['id_label'] + " (" + str(data['run_date']) + ")",
info = data['info']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment