Commit d2a0857d authored by Marc Duez's avatar Marc Duez

server: rework info views

parent baeeff64
......@@ -70,8 +70,8 @@ def run_request():
).select()
if len(row) > 0 : ## update
data_id = row[0].data_file.id
db.data_file[data_id] = dict(state = 'queued')
data_id = row[0].id
db.data_file[data_id] = dict(status = 'queued')
else: ## create
data_id = db.data_file.insert(sequence_file_id = request.vars['sequence_file_id'],
config_id = request.vars['config_id'],
......@@ -95,7 +95,8 @@ def run_request():
, repeats = 1, timeout = 6000)
res = {"redirect": "patient/info",
"args" : { "id" : id_patient },
"args" : { "id" : id_patient,
"config_id" : request.vars["config_id"]},
"message": "request added"}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
......
......@@ -3,10 +3,12 @@
{{('message' in globals())}}
{{if 'message' in globals():}}
{{if request.vars["config_id"]:}}
{{if request.vars["config_id"] and not request.vars["config_id"] == -1 :}}
{{config_id = long(request.vars["config_id"])}}
{{config = True}}
{{else:}}
{{config_id = db(db.config).select()[0].id}}
{{config_id = -1}}
{{config = False}}
{{pass}}
{{
......@@ -27,10 +29,8 @@ patient = db.patient[request.vars["id"]]
choose config
<span>
<select id="choose_config" name="config" onchange="db.call('patient/info', {'id' :'{{=request.vars['id']}}', 'config_id' : this.value})">
{{
query = db(db.config).select()
for row in query :}}
<option value="-1" {{if not config :}}selected{{pass}}> --- </option>
{{for row in db(db.config).select() :}}
<option value="{{=row.id }}" {{if row.id==config_id:}}selected{{pass}} >
{{=row.name}}
</option>
......@@ -54,8 +54,8 @@ patient = db.patient[request.vars["id"]]
<td class="column_sep"></td>
<td class="column4"> status </td>
<td class="column2"> vidjil run date </td>
<td class="column2"> last run </td>
<td class="column4"> </td>
</tr>
</thead>
......@@ -83,23 +83,22 @@ patient = db.patient[request.vars["id"]]
<td id="sequence_file_{{=row.sequence_file.id}}"> {{=filename}}</td>
<td> {{=row.sequence_file.sampling_date}} </td>
<td> {{=row.sequence_file.info}} </td>
<td> {{if filename != '':}}
<a href="{{=URL('download', scheme='https', args=row.sequence_file.data_file)}}" >dl</a>
{{pass}}
</td>
<td> {{if filename != '':}}<a href="{{=URL('download', scheme='https', args=row.sequence_file.data_file)}}" >dl</a>{{pass}}</td>
<td onclick="db.call('file/edit', {'id' :'{{=row.sequence_file.id}}', 'patient_id' :'{{=request.vars['id']}}'} )" > e </td>
<td onclick="db.call('file/confirm', {'id' :'{{=row.sequence_file.id}}', 'patient_id' :'{{=request.vars['id']}}'} )" > X </td>
<td class="column_sep"></td>
<td> {{if row.data_file.id == None :}}
<span class="button" onclick="db.call('default/run_request', { 'sequence_file_id' : '{{=row.sequence_file.id}}',
'config_id' : {{=config_id}} } )"> run >> </span>
{{else:}}
{{=row.data_file.status}}
{{pass}}
<td> {{if row.data_file.run_date :}}{{=row.data_file.run_date }}{{pass}} </td>
<td>
{{if filename != '':}}
{{if row.data_file.id == None or row.data_file.status == "ready" :}}
<span class="button" onclick="db.call('default/run_request', { 'sequence_file_id' : '{{=row.sequence_file.id}}', 'config_id' : {{=config_id}} } )"> run >> </span>
{{else:}}
{{=row.data_file.status}}
{{pass}}
{{pass}}
</td>
<td> {{=row.data_file.run_date}} </td>
</tr>
{{pass}}
</tbody>
......
......@@ -15,7 +15,14 @@ query = db(
<div>
<h3>{{=message}} {{=request.vars["id"]}}</h3>
</div>
<div class="db_block">
<div class="db_block_left">
create patient <input type="checkbox" name="patient" onclick="db.patient_right(this.checked, this.name, {{=request.vars["id"]}});"></br>
<!--create config <input type="checkbox" name="config" onclick="db.test(this.checked, this.name, {{request.vars["id"]}});"></br>-->
</div>
</div>
<div id="db_table_container">
<table class="db_table" id="table">
<thead>
......
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