Commit 3377438a authored by Mathieu Giraud's avatar Mathieu Giraud Committed by Vidjil Team
Browse files

controllers/patient.py: go to 'prev' or 'next' patient

This is now only for the admins, and should be extended to work for any user.
parent 0feb2fcb
...@@ -11,7 +11,16 @@ ACCESS_DENIED = "access denied" ...@@ -11,7 +11,16 @@ ACCESS_DENIED = "access denied"
## return patient file list ## return patient file list
## ##
def info(): def info():
if 'next' in request.vars:
try:
new_id = request.vars["id"]
new_id = str(int(new_id)+int(request.vars["next"]))
while db.patient[new_id] is None and int(new_id) > 0:
new_id = str(int(new_id)+int(request.vars["next"]))
request.vars["id"] = new_id
except:
pass
patient = db.patient[request.vars["id"]] patient = db.patient[request.vars["id"]]
......
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
<div> <div>
{{if auth.has_membership('admin'):}}
<span class="button" onclick="db.call('patient/info', {'next': '1', 'id' :'{{=request.vars['id']}}', 'config_id' : '{{=request.vars['config_id']}}'})">prev</span>
<span class="button" onclick="db.call('patient/info', {'next': '-1', 'id' :'{{=request.vars['id']}}', 'config_id' : '{{=request.vars['config_id']}}'})">next</span>
{{ pass }}
<h3>{{=vidjil_utils.anon(request.vars['id'], auth.user.id)}}</h3> <h3>{{=vidjil_utils.anon(request.vars['id'], auth.user.id)}}</h3>
<div class="db_block"> <div class="db_block">
......
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