index.html 5.32 KB
Newer Older
marc's avatar
marc committed
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
{{extend 'db_layout.html'}}
{{import vidjil_utils}}

{{total_file_count = 0 ; total_size = 0}}

<h3></h3>

<div class="db_block">
    <div class="db_block_left">
        search
        <input id="db_filter_input" type="text" value="{{=request.vars["filter"]}}"  onchange="db.call('patient/index', {'filter' : this.value} )">
    </div>
</div>

<div id="db_table_container">
    <table class="db_table" id="table">


        <thead>
            <tr><td class="column_200 pointer" onclick="db.call('run/index', {'sort' :'name', 'filter' : '{{=request.vars["filter"]}}'
                  {{if not reverse and request.vars["sort"]=="name" :}} , 'reverse' : true {{pass}} })"> name </td>
                
                <td class="column_100 pointer" onclick="db.call('run/index', {'sort' :'run_date', 'filter' : '{{=request.vars["filter"]}}'
                  {{if not reverse and request.vars["sort"]=="run_date" :}} , 'reverse' : true {{pass}} })"> date </td>
                
                <td class="pointer" onclick="db.call('run/index', {'sort' :'info', 'filter' : '{{=request.vars["filter"]}}'
                  {{if not reverse and request.vars["sort"]=="info" :}} , 'reverse' : true {{pass}} })"> info </td>
                
                <td class="pointer" class="column_100" onclick="db.call('run/index', {'sort' :'configs', 'filter' : '{{=request.vars["filter"]}}'
                  {{if not reverse and request.vars["sort"]=="configs" :}} , 'reverse' : true {{pass}} })"> configs </td>
                
{{if isAdmin:}} <td class="column_100 pointer" onclick="db.call('run/index', {'sort' :'groups', 'filter' : '{{=request.vars["filter"]}}'
                  {{if not reverse and request.vars["sort"]=="groups" :}} , 'reverse' : true {{pass}} })"> groups </td> {{pass}}
                
{{if isAdmin:}} <td class="column_100 pointer" onclick="db.call('run/index', {'sort' :'creator', 'filter' : '{{=request.vars["filter"]}}'
                  {{if not reverse and request.vars["sort"]=="creator" :}} , 'reverse' : true {{pass}} })"> creator </td> {{pass}}
                
                <td class="column_100 pointer" onclick="db.call('run/index', {'sort' :'files', 'filter' : '{{=request.vars["filter"]}}'
                  {{if not reverse and request.vars["sort"]=="files" :}} , 'reverse' : true {{pass}} })"> files </td>
                
                
                <td class="column5"> </td>
                <td class="column5"> </td>
                <td class="column5"> </td>
            </tr>
        </thead>
        
        
       {{for row in query :}}
           <tr class="pointer" onclick="db.call('sample_set/index', {'id' :'{{=row['sample_set_id']}}' , 'config_id' : {{=row['most_used_conf']}} } )" >
                <td> {{=row['name']}} </td>
                <td> {{ if row['run_date'] is not None: }} {{=row['run_date'] }} {{ pass }} </td>
                <td> {{=row['info']}} </td>
                <td>
                  {{ configs = [] }}
                  {{for conf in row['conf_list'] :}}
57
                    {{filename = row['name'] + " (" + conf['name'] + ")"}}
marc's avatar
marc committed
58
                    {{if conf['fused_file'] is not None :}}
59
                      {{ configs.append(str(A(conf['name'], _href="index.html?sample_set=" + str(row['sample_set_id']) + "&config=" + str(conf['id']), _type="text/html",
60
                            _onclick="event.preventDefault();event.stopPropagation();if( event.which == 2 ) { window.open(this.href); } else { myUrl.loadUrl(db, { 'sample_set_id' : '" + str(row['sample_set_id']) + "' , 'config' : " + str(conf['id']) + " }, '" + filename + "' ); }"))) }}
marc's avatar
marc committed
61 62 63 64 65 66 67 68 69 70 71
                    {{else:}}
                      {{ configs.append(conf['name']) }}
                    {{pass}}
                  {{pass}}
                  {{= XML(", ".join(configs)) }}
                </td>
{{if isAdmin:}} <td> {{=row['groups']}}</td>{{pass}}
{{if isAdmin:}} <td> {{=row['creator']}}</td>{{pass}}
                <td> {{=row['file_count']}} ({{=vidjil_utils.format_size(row['size'])}}) </td>
            {{ total_file_count += row['file_count'] ; total_size += row['size'] }}
               
72
{{if isAdmin:}} <td onclick="db.call('run/permission', {'id' :'{{=row['id']}}'} )" > <i class="icon-key" title="set permissions"></i>  </td> {{else:}} <td></td> {{pass}}
marc's avatar
marc committed
73
                {{if row['has_admin_permission']:}}
74 75
                <td onclick="db.call('run/edit', {'id' :'{{=row['id']}}'} )" >  <i class="icon-pencil-2" title="edit run information"></i> </td>
                <td onclick="db.call('run/confirm', {'id' :'{{=row['id']}}'} )" >  <i class="icon-erase" title="delete run"></i> </td>
marc's avatar
marc committed
76 77 78 79 80 81 82 83 84 85 86 87
                {{else:}}  <td></td><td></td>{{pass}}
            </tr>
        {{pass}}

    </table>
    <table class="db_table" id="db_fixed_header"></table>
</div>

<div class="db_block">
    <div class="db_block_left">

{{if auth.can_create_patient():}}
Vidjil's avatar
Vidjil committed
88
<span class="button2" onclick="db.call('run/add')"> + new runs </span>
89
<span class="button2" onclick="db.call('sample_set/custom', {'filter': '{{=request.vars['filter']}}' })"> compare samples/runs </span>
marc's avatar
marc committed
90 91 92 93 94 95 96 97 98 99
{{else:}}
<!-- <span class="button2 inactive" onclick="db.call('patient/add')" title="you don't have permission to create new patient"> add patient </span> -->
{{pass}}

  </div>
  <div class="db_block_right">
  <br />
  {{ =len(query) }} runs, {{ =total_file_count }} files ({{ =vidjil_utils.format_size(total_size) }})
  </div>
</div>