Merge pull request #5248 from solgenomics/topic/batch_update_trials
[sgn.git] / mason / stock / vector_related_stocks.mas
blob2231b34a5c881ab0502c0e9be91533a16aca01bf
2 <%args>
3 $stock_id
4 $stock_uniquename => undef
5 $stock_type => undef
6 </%args>
8 <div style="overflow:scroll">
9     <table class="table table-hover table-bordered" id="vector_related_stocks_table">
10         <thead>
11             <tr>
12                 <th>Accession (Transformant)</th>
13                 <th>Vector Construct</th>
14                 <th>Plant Material</th>
15                 <th>Transformation ID</th>
16             </tr>
17         </thead>
18     </table>
19 </div>
21 <div class="panel panel-default">
22     <div class="panel-body">
23         <&| /page/info_section.mas, title => 'Copy Accessions to a List', collapsible=>1, collapsed=>0, subtitle=>'<i>Copy the accession (transformant) names showing in table to a new or exisiting list</i>'&>
24         <br>
25         <div id="transformant_names" style="display:none"></div>
26         <div id="transformants_to_list_menu"></div>
27         </&>
28     </div>
29 </div>
31 <script>
33 jQuery(document).ready(function(){
35         var related_stocks_table = jQuery('#vector_related_stocks_table').DataTable({
36             'ordering': false,
37             'autoWidth': false,
38             'ajax':'/stock/'+ <% $stock_id %> + '/datatables/vector_related_stocks',
39             "fnInitComplete": function(oSettings, json) {
40                 //console.log(json);
41                 if (!isLoggedIn()) {
42                     jQuery('#transformants_to_list_menu').html("<div class='well well-sm'><h3>Please login to use lists!</h3></div>");
43                 } else {
44                     var html = "";
45                     for(var i=0; i<json.data.length; i++){
46                         html += json.data[i][4]+"\n";
47                     }
48                     jQuery("#transformant_names").html(html);
49                     addToListMenu("transformants_to_list_menu", "transformant_names", {
50                         selectText: true,
51                         listType:'accessions'
52                     });
53                 }
54             }
55         });
58 });
61 </script>