Commit 82f01d9a authored by HERBERT Ryan's avatar HERBERT Ryan
Browse files

added basic listing for sequence_file specific results (result history)

parent 8c4291a5
......@@ -56,6 +56,29 @@ def index():
return dict(query = query,
reverse=reverse)
def list():
patient = db.patient(request.vars['id'])
query = db(
(db.sequence_file.id==request.vars['sequence_file_id'])
& (db.sequence_file.patient_id==db.patient.id)
& (db.results_file.config_id==db.config.id)
).select(
orderby = ~db.results_file.run_date
)
for row in query :
if row.results_file.scheduler_task_id is None :
row.status = ''
else:
row.status = db.scheduler_task[row.results_file.scheduler_task_id ].status
pass
if "filter" not in request.vars :
request.vars["filter"] = ""
return dict(query = query,
patient = patient)
def run_all():
if auth.is_admin():
query = db(
......
{{extend 'db_layout.html'}}
<div class="db_block">
<div class="db_block_left">
search
<input id="db_filter_input" type="text" value="{{=request.vars["filter"]}}" onchange="db.call('results_file/list', {'filter' : this.value} )">
</div>
</div>
<div id="db_table_container">
<table class="db_table" id="table">
<thead>
<tr>
<td class="column1" >file_name</td>
<td class="column2" >config</td>
<td> </td>
<td class="column1">patient</td>
<td class="column2">producer</td>
<td class="column2">last process</td>
<td class="column2">status</td>
<td class="column5"></td>
<td class="column4"></td>
</tr>
</thead>
{{for row in query :}}
<tr>
<td> {{=row.sequence_file.filename}} </td>
<td> {{=row.config.name}} </td>
<td></td>
<td> {{=row.patient.last_name + " " + row.patient.first_name }} </td>
<td> {{=row.sequence_file.producer}} </td>
{{if row.results_file.run_date :}}
<td class="button" onclick="db.call('results_file/info', { 'results_file_id' : '{{=row.results_file.id}}' } )"> {{=row.results_file.run_date }}</td>
{{else:}}<td></td>{{pass}}
<td> {{=row.status}} </td>
<td class="pointer" onclick="db.call('results_file/confirm', {'results_file_id' :'{{=row.results_file.id}}'})" > X </td>
<td>
{{if row.results_file.id == None or ( row.status != "RUNNING" and row.status != "QUEUED" and row.status != "ASSIGNED"):}}
{{if auth.can_process_file() :}}
<span class="button" onclick="db.call('default/run_request', { 'sequence_file_id' : '{{=row.sequence_file.id}}', 'config_id' : {{=row.config.id}} } )"> run >> </span>
{{else:}}<span class="button inactive" title="you don't have permission to schedule runs"> run >> </span>{{pass}}
{{pass}}
</td>
</tr>
{{pass}}
</table>
<table class="db_table" id="db_fixed_header"></table>
</div>
\ No newline at end of file
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