index.html 1.57 KB
Newer Older
1 2
{{extend 'db_layout.html'}}

3 4 5 6 7 8
{{('message' in globals())}}
{{if 'message' in globals():}}

<div>
    <h3>{{=message}}</h3>
    
Marc Duez's avatar
Marc Duez committed
9 10 11 12 13 14 15 16
    <div id="db_table_container">
        <table class="db_table" id="table">
            <thead>
                <tr><td class="column1"> name </td>
                    <td class="column2"> birth </td>
                    <td> info </td>
                    <td class="column5"> </td>
                    <td class="column5"> </td>
17
                    <td class="column5"> </td>
Marc Duez's avatar
Marc Duez committed
18 19 20
                </tr>
            </thead>
           {{ 
21 22 23 24
           query = db(
               auth.accessible_query('read', db.patient) |
               auth.accessible_query('admin', db.patient)
           ).select()
Marc Duez's avatar
Marc Duez committed
25 26 27 28 29
           for row in query :}}
               <tr onclick="db.call('patient/info', {'id' :'{{=row.id}}'} )" >
                    <td> {{=row.last_name + " " + row.first_name }} </td>
                    <td> {{=row.birth }} </td>
                    <td> {{=row.info }} </td>
30
                    <td onclick="db.call('patient/permission', {'id' :'{{=row.id}}'} )" > p </td>
Marc Duez's avatar
Marc Duez committed
31 32 33 34 35 36 37 38
                    <td onclick="db.call('patient/edit', {'id' :'{{=row.id}}'} )" > e </td>
                    <td onclick="db.call('patient/confirm', {'id' :'{{=row.id}}'} )" > X </td>  
                </tr>
            {{pass}}
        </table>
        <table class="db_table" id="db_fixed_header"></table>
    </div>
    
Marc Duez's avatar
Marc Duez committed
39
    <span class="button" onclick="db.call('patient/add')"> add patient </span>
40 41 42 43 44 45 46
</div>

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