Commit 2e4da038 authored by HERBERT Ryan's avatar HERBERT Ryan

Adding functionnality to config links to match behaviour of existing link in patient file details

parent 77ef29ab
......@@ -374,13 +374,14 @@ def index():
query3 = db(
(db.patient.id == db.fused_file.patient_id) &
(db.fused_file.config_id == db.config.id)
(db.fused_file.config_id == db.config.id) &
(auth.accessible_query('read', db.config) | auth.accessible_query('admin', db.config) )
).select(
db.patient.id, db.config.name, db.config.id
db.patient.id, db.config.name, db.config.id, db.fused_file.fused_file
)
for i, row in enumerate(query3) :
if row.patient.id in keys :
result[row.patient.id]['conf_list'].append({'id': row.config.id, 'name': row.config.name})
result[row.patient.id]['conf_list'].append({'id': row.config.id, 'name': row.config.name, 'fused_file': row.fused_file.fused_file})
#result[row.patient.id]['conf_list'].append(row.config.name)
result[row.patient.id]['conf_id_list'].append(row.config.id)
......
......@@ -49,7 +49,15 @@
<td> {{=row['info'] }} </td>
<td>
{{for conf in row['conf_list'] :}}
<a href="index.html?patient={{=row['id']}}&config={{=conf['id']}}">{{=conf['name']}}</a>
{{filename = vidjil_utils.anon_ids(row['id']) + " (" + conf['name'] + ")"}}
{{if conf['fused_file'] is not None :}}
<a href="index.html?patient={{=row['id']}}&config={{=conf['id']}}" type="text/html"
onclick="event.preventDefault()
event.stopPropagation()
if( event.which == 2 ) { window.open(this.href) }
else { db.load_data( { 'patient' : '{{=row['id']}}' , 'config' : {{=conf['id']}} }, '{{=filename}}' ) }" >
{{pass}}
{{=conf['name']}} </a>
{{pass}}
</td>
{{if isAdmin:}} <td> {{=row['groups']}}</td>{{pass}}
......
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