all.html 3.91 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
{{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
11
        <input id="db_filter_input" type="text" value="{{=request.vars["filter"]}}"  onchange="db.call('sample_set/all', {'type': '{{=helper.get_type()}}', 'filter' : this.value} )"
12
        onfocus="new VidjilAutoComplete().setupTags(this);"
13
        data-needs-atwho="true" data-keys="{{=group_ids}}">
14 15 16 17 18 19
    </div>
</div>

<div id="db_table_container">
    <table class="db_table" id="table">
        <thead>
20
	    <tr>
21
	      <td class="column4"></td>
HERBERT Ryan's avatar
HERBERT Ryan committed
22
            {{ for header in fields: }}
23 24
	        {{if isAdmin or header['public']:}}
	            <td class="{{if header['width']:}}column_{{=header['width']}}{{pass}} pointer"
25
                 onclick="db.call('sample_set/all', {'type': '{{=helper.get_type()}}', 'sort' : '{{=header['sort']}}', 'filter' : '{{=request.vars["filter"]}}'
26
		            {{if not reverse and request.vars["sort"]==header['sort'] :}} , 'reverse' : true {{pass}} })">
27 28 29 30
                        {{=header['name']}}
                    </td>
                {{ pass }}
            {{ pass }}
31 32 33 34 35 36 37 38
                
                <td class="column5"> </td>
                <td class="column5"> </td>
                <td class="column5"> </td>
            </tr>
        </thead>
        
        
HERBERT Ryan's avatar
HERBERT Ryan committed
39 40
       {{for i in range(0, min(len(query), step)) :}}
           {{data = query[i]}}
HERBERT Ryan's avatar
HERBERT Ryan committed
41
           <tr class="pointer" onclick="db.call('sample_set/index', {'id' :'{{=data.sample_set_id}}' , 'config_id' : {{=data.most_used_conf}} } )" >
42
	       <td class="uid">{{=data.sample_set_id}}</td>
HERBERT Ryan's avatar
HERBERT Ryan committed
43
               {{ for field in fields: }}
44
  		   <td>
HERBERT Ryan's avatar
HERBERT Ryan committed
45
		       {{= field['call'](data)}}
46 47
                   </td>
               {{ pass }}
48 49
            {{ total_file_count += data.file_count ; total_size += data.size }}
               
50
{{if isAdmin:}} <td onclick="db.call('sample_set/permission', {'id' :'{{=data.sample_set_id}}'} )" > <i class="icon-key" title="set permissions"></i> </td> {{else:}} <td></td> {{pass}}
51
                {{if data.has_permission:}}
Ryan Herbert's avatar
Ryan Herbert committed
52
		<td onclick="db.call('sample_set/form', {'id' :'{{=data.sample_set_id}}'} )" > <i class="icon-pencil-2" title="{{='edit %s information' % 'sample_set'}}"></i> </td>
53
		<td onclick="db.call('sample_set/confirm', {'id' :'{{=data.sample_set_id}}'} )" > <i class="icon-erase" title="{{='delete %s' % helper.get_type_display()}}"></i> </td>
54 55 56 57 58 59 60 61 62 63 64 65
                {{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():}}
Ryan Herbert's avatar
Ryan Herbert committed
66
<span class="button2" onclick="db.call('sample_set/form', {'type': '{{=helper.type}}'})"> + new {{=helper.get_type_display()}} </span>
67 68
<span class="button2" onclick="db.call('sample_set/custom', {'filter': '{{=request.vars['filter']}}' })"> compare samples/patients </span>
{{else:}}
69
<!-- <span class="button2 inactive" onclick="db.call('sample_set/add')" title="you don't have permission to create new {{=helper.get_type_display()}}s"> add sample_set </span> -->
70
{{pass}}
Ryan Herbert's avatar
Ryan Herbert committed
71
<span class="button2 devel-mode" onclick="db.call('sample_set/stats', {'type': '{{=helper.get_type()}}', 'filter': '{{=request.vars['filter']}}'})">stats</span>
72 73 74 75

  </div>
  <div class="db_block_right">
  <br />
76
  {{ =min(step, len(query)) }} {{=helper.get_type_display()}}s, {{ =total_file_count }} files ({{ =vidjil_utils.format_size(total_size) }})
77 78
  </div>
</div>
79 80 81 82 83 84 85 86 87 88
<div class="db_block_center">
    page:
    {{ if page > 0: }}
        <i class="icon-left-open-1" onclick="db.call('sample_set/all', {'type': '{{=helper.get_type()}}', 'page': {{=page-1}}})"></i>
    {{ pass }}
    {{= page + 1 }}
    {{if len(query) > step : }}
        <i class="icon-right-open-1" onclick="db.call('sample_set/all', {'type': '{{=helper.get_type()}}', 'page': {{=page+1}}})"></i>
    {{ pass }}
</div>