fix test with new description field.
[sgn.git] / mason / search / genotyping_data_projects.mas
blob7173488f7521448de0f3f60c340c32cfaaad3240
2 <%args>
3 </%args>
5 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery.dataTables' ] &>
7 <& /page/page_title.mas, title => "Genotyping Project Search" &>
9 <div class="well well-sm">
10     <div class="panel panel-default">
11         <div class="panel-body">
12             <table id="genotyping_data_project_search_results" width="100%" class="table table-hover table-striped">
13                 <thead>
14                     <tr>
15                         <th>Genotyping Project Name</th>
16                         <th>Data Type</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>Number of Plates</th>
24                         <th>Total Number of Accessions</th>
25                     </tr>
26                 </thead>
27             </table>
28         </div>
29     </div>
31     <div class="panel panel-default">
32         <div class="panel-body">
33             <br><br>
34             <&| /page/info_section.mas, title => 'Copy Results to a List', collapsible=>1, collapsed=>0, subtitle=>'<i>Copy the genotyping project names currently showing in the search results table to a new or exisiting list</i>'&>
35                 <br>
36                 <div style="text-align:right" id="genotyping_data_project_to_list_menu"></div>
37                 <div id="genotyping_data_project_result_names" style="display: none;"></div>
38             </&>
39         </div>
40     </div>
41 </div>
44 <script>
46 jQuery(document).ready(function () {
48    var trial_table = jQuery('#genotyping_data_project_search_results').DataTable( {
49        'ajax': '/ajax/genotyping_data_project/search',
50        "scrollX": true
51    });
53    jQuery('#genotyping_data_project_search_results').on( 'draw.dt', function () {
54      var name_links = trial_table.column( 0, {page:'current'} ).data();
55      var names = [];
57      for (var i = 0; i < name_links.length; i++) { //extract text from anchor tags
58        names.push(name_links[i].match(/<a [^>]+>([^<]+)<\/a>/)[1]+'\n');
59      }
61      jQuery('#genotyping_data_project_result_names').html(names);
62      addToListMenu('genotyping_data_project_to_list_menu', 'genotyping_data_project_result_names', {
63        listType: 'genotyping_projects'
64      });
66    });
68 });
70 </script>