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

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

6 7 8 9 10 11 12 13 14 15 16 17 18 19
{{ 
count = db.patient.id.count()

query = db(
    (auth.accessible_query('read', db.patient) | auth.accessible_query('admin', db.patient) ) &
    (db.patient.id == db.sequence_file.patient_id)
).select(
    db.patient.ALL,
    count,
    groupby=db.patient.id
)
}}


20 21 22
<div>
    <h3>{{=message}}</h3>
    
Marc Duez's avatar
Marc Duez committed
23 24 25 26 27 28
    <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>
29
                    <td class="column2"> files </td>
Marc Duez's avatar
Marc Duez committed
30 31
                    <td class="column5"> </td>
                    <td class="column5"> </td>
32
                    <td class="column5"> </td>
Marc Duez's avatar
Marc Duez committed
33 34
                </tr>
            </thead>
35 36 37 38 39 40 41 42 43
           {{for row in query :}}
               <tr onclick="db.call('patient/info', {'id' :'{{=row.patient.id}}'} )" >
                    <td> {{=row.patient.last_name + " " + row.patient.first_name }} </td>
                    <td> {{=row.patient.birth }} </td>
                    <td> {{=row.patient.info }} </td>
                    <td> {{=row[count]}}</td>
                    <td onclick="db.call('patient/permission', {'id' :'{{=row.patient.id}}'} )" > p </td>
                    <td onclick="db.call('patient/edit', {'id' :'{{=row.patient.id}}'} )" > e </td>
                    <td onclick="db.call('patient/confirm', {'id' :'{{=row.patient.id}}'} )" > X </td>  
Marc Duez's avatar
Marc Duez committed
44 45 46 47 48 49
                </tr>
            {{pass}}
        </table>
        <table class="db_table" id="db_fixed_header"></table>
    </div>
    
Marc Duez's avatar
Marc Duez committed
50
    <span class="button" onclick="db.call('patient/add')"> add patient </span>
51 52 53 54 55 56 57
</div>

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