Merge pull request #5205 from solgenomics/topic/generic_trial_upload
[sgn.git] / mason / search / genotyping_trials.mas
blob9fb2fd804935f2f3ec5723e053a805d66cbe6cdd
2 <%args>
3 $nd_geolocation => 'not_provided'
4 </%args>
6 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery.dataTables' ] &>
8 <& /page/page_title.mas, title => "Genotyping Plate Search" &>
10 <div class="well well-sm">
11     <div class="panel panel-default">
12         <div class="panel-body">
13             <table id="genotyping_trial_search_results" width="100%" class="table table-hover table-striped">
14             <thead>
15               <tr>
16                   <th>Plate Name</th>
17                   <th>Description</th>
18                   <th>Breeding program</th>
19                   <th>Folder</th>
20                   <th>Year</th>
21                   <th>Location</th>
22                   <th>Genotyping Facility</th>
23                   <th>Format</th>
24                   <th>Sample Type</th>
25                   <th>Download</th>
26             </tr>
27             </thead>
28             </table>
29         </div>
30     </div>
32     <div class="panel panel-default">
33         <div class="panel-body">
34             <br><br>
35             <&| /page/info_section.mas, title => 'Copy Results to a List', collapsible=>1, collapsed=>0, subtitle=>'<i>Copy the trial names currently showing in the search results table to a new or exisiting list</i>'&>
36                 <br>
37                 <div style="text-align:right" id="genotyping_trials_to_list_menu"></div>
38                 <div id="genotyping_trial_result_names" style="display: none;"></div>
39             </&>
40         </div>
41     </div>
42 </div>
45 <script>
47 jQuery(document).ready(function () {
49     var trial_table = jQuery('#genotyping_trial_search_results').DataTable( {
50         'ajax': '/ajax/tissue_samples/genotyping_trials',
51         "scrollX": true
52      });
54     jQuery('#genotyping_trial_search_results').on( 'draw.dt', function () {
55         var name_links = trial_table.column( 0, {page:'current'} ).data();
56         var names = [];
58         for (var i = 0; i < name_links.length; i++) { //extract text from anchor tags
59             names.push(name_links[i].match(/<a [^>]+>([^<]+)<\/a>/)[1]+'\n');
60         }
62         jQuery('#genotyping_trial_result_names').html(names);
63         addToListMenu('genotyping_trials_to_list_menu', 'genotyping_trial_result_names', {
64             listType: 'genotyping_plates'
65         });
66     });
68 });
70 </script>