patient_list_old.html 2.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
{{('message' in globals())}}
{{extend 'layout_fluid.html'}}

{{if 'message' in globals():}}

<div class="span7">
<h3>{{=message}}</h3>

<table class="table">
    <thead>
        <tr><td> name </td>
            <td> gender </td>
            <td> birth </td>
            <td>  </td>

        </tr>
    </thead>
    <tbody>

        {{ query = None
        c_id = ""}}

        {{if "admin" in auth.user_groups.values():}}
            {{query = db( db.patient.id==db.auth_permission.record_id ).select( orderby = db.patient.id) }}
        {{else:}}
            {{query = db( 
                ( db.auth_permission.record_id==db.patient.id ) 
                & ( db.auth_permission.table_name=="patient" ) 
                & ( db.auth_permission.name=="read" ) 
                & ( db.auth_permission.group_id.belongs(auth.user_groups) ) 
                ).select( orderby = db.patient.id)
            }}
        {{pass}}

        {{for row in query :}}
        
            {{if (c_id != row.patient.id) :
                c_id = row.patient.id}}
        <tr class="tabrow" onclick="window.location = '{{=URL(f='patient', args=[row.patient.id])}}' ">
                <td> {{=row.patient.last_name + " " + row.patient.first_name }} </td>
                <td> {{=row.patient.sex }} </td>
                <td> {{=row.patient.birth }} </td>
                <td> {{=row.patient.info }} </td>
            </tr>
            {{pass}}
        plop
        {{pass}}
    </tbody>
</table>
    {{=A(str(T('back')),_href=URL('index'),_class="btn")}}
    {{=A(str(T('add patient')),_href=URL('add_patient_form'),_class="btn")}}
</div>

<div class="span5">
     <div class="well well-small">
         <h3>
             info 
         </h3>
         fenetre ajax / affichage info_patient ...
             <br>TODO
             <br>.
             <br>.
             <br>.
             <br>.
    </div>
        {{=A(str(T('edit info (TODO)')),_href=URL('index'),_class="btn")}}
</div>


{{elif 'content' in globals():}}
{{=content}}
{{else:}}
{{=BEAUTIFY(response._vars)}}
{{pass}}