PageRenderTime 24ms CodeModel.GetById 18ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/templates/requests/common/find_samples.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 95 lines | 89 code | 6 blank | 0 comment | 4 complexity | 113b3aac0a25d6a7645c5c1bab173560 MD5 | raw file
 1<%inherit file="/base.mako"/>
 2<%namespace file="/message.mako" import="render_msg" />
 3
 4<%def name="javascripts()">
 5   ${parent.javascripts()}
 6   ${h.js("jquery.autocomplete", "autocomplete_tagging" )}
 7</%def>
 8
 9<%def name="stylesheets()">
10    ${parent.stylesheets()}
11    ${h.css( "autocomplete_tagging" )}
12</%def>
13
14<% is_admin = cntrller == 'requests_admin' and trans.user_is_admin() %>
15
16<br/>
17<br/>
18<ul class="manage-table-actions">
19    <li>
20        <a class="action-button"  href="${h.url_for( controller=cntrller, action='browse_requests' )}">Browse requests</a>
21    </li>
22</ul>
23
24%if message:
25    ${render_msg( message, status )}
26%endif
27
28<div class="toolForm">
29    <div class="toolFormTitle">Find samples</div>
30    <div class="toolFormBody">
31        <form name="find_request" id="find_request" action="${h.url_for( controller='requests_common', action='find_samples', cntrller=cntrller )}" method="post" >
32            <div class="form-row">
33                <label>Find samples using:</label>
34                ${search_type.get_html()}
35                <div class="toolParamHelp" style="clear: both;">
36                    Select a sample attribute for searching.  To search <br/>
37                    for a sample with a dataset name, select the dataset <br/>
38                    option above. This will return all the samples that <br/>
39                    are associated with a dataset with that name. <br/> 
40                </div>
41            </div>
42            <div class="form-row">
43                <label>Show only sequencing requests in state:</label>
44                ${request_states.get_html()}
45            </div>
46            <div class="form-row">
47                ${search_box.get_html()}
48                <input type="submit" name="find_samples_button" value="Find"/>  
49                <div class="toolParamHelp" style="clear: both;">
50                   <p>
51                   Wildcard search (%) can be used as placeholder for any sequence of characters or words.<br/> 
52                   For example, to search for samples starting with 'mysample' use 'mysample%' as the search string.
53                   </p>
54                   <p>
55                   When 'form value' search type is selected, then enter the search string in 'field label=value' format.
56                   <br/>For example, when searching for all samples whose 'Volume' field is 1.3mL, then the search string
57                   should be 'Volume=1.3mL' (without qoutes).
58                   </p>
59                </div>
60            </div>
61            %if results:
62	            <div class="form-row">
63                    <label><i>${results}</i></label>
64                    %if samples:
65		                <div class="toolParamHelp" style="clear: both;">
66		                   The search results are sorted by the date the samples where created. 
67		                </div>
68	                %endif
69	            </div>
70	        %endif
71            <div class="form-row">
72	            %if samples:
73	                %for sample in samples:
74	                    <div class="form-row">
75                            Sample: <b>${sample.name}</b> | Barcode: ${sample.bar_code}<br/>
76                            %if sample.request.is_new or not sample.state:
77                                State: Unsubmitted<br/>
78                            %else:
79                                State: ${sample.state.name}<br/>
80                            %endif
81                            Datasets: <a href="${h.url_for( controller='requests_common', action='view_sample_datasets', cntrller=cntrller, sample_id=trans.security.encode_id( sample.id ) )}">${len( sample.datasets )}</a><br/>
82                            %if is_admin:
83                               <i>User: ${sample.request.user.email}</i>
84                            %endif
85                            <div class="toolParamHelp" style="clear: both;">
86                                <a href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( sample.request.id ) )}">Sequencing request: ${sample.request.name} | Type: ${sample.request.type.name} | State: ${sample.request.state}</a>
87                            </div>
88	                    </div>
89	                    <br/>
90	                %endfor
91	            %endif
92            </div>
93        </form>
94    </div>
95</div>