fix test with new description field.
[sgn.git] / mason / search / genotyping_protocols.mas
blobeaeec0f42e4f3f76ac0ad1e105fc0dc7a2d80828
2 <%args>
3 </%args>
5 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery.dataTables' ] &>
7 <& /page/page_title.mas, title => "Genotyping Protocol Search" &>
9 <div class="well well-sm">
10     <div class="panel panel-default">
11         <div class="panel-body">
12             <table id="genotyping_protocol_search_results" width="100%" class="table table-hover table-striped">
13                 <thead>
14                     <tr>
15                         <th>Protocol</th>
16                         <th>Marker Type</th>
17                         <th>Header Description</th>
18                         <th>Number of Markers</th>
19                         <th>Protocol Description</th>
20                         <th>Reference Genome</th>
21                         <th>Species Name</th>
22                         <th>Sample Type</th>
23                         <th>Create Date</th>
24                     </tr>
25                 </thead>
26             </table>
27         </div>
28     </div>
29 <!--
30     <div class="panel panel-default">
31         <div class="panel-body">
32             <br><br>
33             <&| /page/info_section.mas, title => 'Copy Results to a List', collapsible=>1, collapsed=>0, subtitle=>'<i>Copy the protocol names currently showing in the search results table to a new or exisiting list</i>'&>
34                 <br>
35                 <div style="text-align:right" id="genotyping_protocol_to_list_menu"></div>
36                 <div id="genotyping_protocol_result_names" style="display: none;"></div>
37             </&>
38         </div>
39     </div>
40 -->
41 </div>
44 <script>
46 jQuery(document).ready(function () {
48    var trial_table = jQuery('#genotyping_protocol_search_results').DataTable( {
49        'ajax': '/ajax/genotyping_protocol/search',
50        "scrollX": true
51    });
53    jQuery('#genotyping_protocol_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_protocol_result_names').html(names);
62      addToListMenu('genotyping_protocol_to_list_menu', 'genotyping_protocol_result_names', {
63      });
65    });
67 });
69 </script>