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

controllers/ 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"
## return patient file list
def info():
if 'next' in request.vars:
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
patient = db.patient[request.vars["id"]]
......@@ -5,6 +5,12 @@
{{if auth.has_membership('admin'):}}
<span class="button" onclick="'patient/info', {'next': '1', 'id' :'{{=request.vars['id']}}', 'config_id' : '{{=request.vars['config_id']}}'})">prev</span>
<span class="button" onclick="'patient/info', {'next': '-1', 'id' :'{{=request.vars['id']}}', 'config_id' : '{{=request.vars['config_id']}}'})">next</span>
{{ pass }}
<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