Merge pull request #5056 from solgenomics/topic/generic_seedlot_upload
[sgn.git] / mason / transformation / transformation.mas
blob6ca63d0199cb6e8981f7c00e205ea1c75f7d4ecd
1 <%args>
2 $transformation_id
3 $transformation_name => ''
4 $user_id => undef
5 $identifier_prefix => ''
6 $next_new_transformant => undef
7 $last_number => undef
8 $plant_material
9 $vector_construct
10 $transformation_notes => undef
11 </%args>
13 <& /util/import_javascript.mas, classes => ["jquery", "jqueryui", "thickbox", "CXGN.Page.FormattingHelpers", "jquery.cookie", "CXGN.List"] &>
14 <& /util/import_javascript.mas, classes => ['jquery','jquery.dataTables'] &>
15 <& /util/import_css.mas, paths => ['/documents/inc/datatables/jquery.dataTables.css'] &>
18 <& /page/page_title.mas, title => "Details for transformation '$transformation_name'" &>
21 <&| /page/info_section.mas, title=>"Details",  collapsible => 1, collapsed=>0 &>
23     <div class="panel panel-default">
24         <div class="panel-body">
25             <div class="row">
26                 <div class="col-sm-6">
27                     <table class="table table-bordered table-hover">
28                         <tr><td><b>Plant Material</b></td><td><%$plant_material%></td></tr>
29                         <tr><td><b>Vector Construct</b></td><td><%$vector_construct%></td></tr>
30                         <tr><td><b>Notes</b></td><td><%$transformation_notes%></td></tr>
31                     </table>
32                 </div>
33             </div>
34             <button class="btn btn-sm btn-primary" style="margin:3px" id="add_new_transformants_link">Add New Transformants (Accessions)</button><button class="btn btn-sm btn-default" style="margin:3px" id="custom_barcode_link">Design Custom Barcodes Using a List</button>
35         </div>
36     </div>
37 </&>
39 <&| /page/info_section.mas, title => 'Transformants (Accessions) Derived from this Transformation ', collapsible=>1, collapsed=>0 &>
40     <div class = "well well-sm">
41         <div class = "panel panel-default">
42             <div class = "panel-body">
43                 <div style="overflow:scroll">
44                     <table class="table table-hover table-bordered" id="transformants_table">
45                         <thead>
46                             <tr>
47                                 <th>Accessions</th>
48                             </tr>
49                         </thead>
50                     </table>
51                 </div>
52                 <div class="panel panel-default">
53                     <div class="panel-body">
54                         <&| /page/info_section.mas, title => 'Add transformants (accessions) to a List', collapsible=>1, collapsed=>1, subtitle=>'<i>Adding transformants (accessions) to a new or exisiting list</i>'&>
55                             <br>
56                             <div id="transformant_to_new_list" style="display:none"></div>
57                             <div id="transformant_add_to_list"></div>
58                         </&>
59                     </div>
60                 </div>
61             </div>
62         </div>
63     </div>
64 </&>
65 <& /transformation/add_transformant_names_dialog.mas, transformation_id => $transformation_id, transformation_name => $transformation_name, next_new_transformant => $next_new_transformant, last_number => $last_number  &>
68 <script>
70 jQuery(document).ready(function(){
72     var transformation_stock_id = "<%$transformation_id%>";
73     var transformants_table = jQuery('#transformants_table').DataTable({
74         'ajax': '/ajax/transformation/transformants/'+transformation_stock_id,
75         'autoWidth': false,
76         "fnInitComplete": function(oSettings, json) {
77             //console.log(json);
78             if (!isLoggedIn()) {
79                 jQuery('#transformant_add_to_list').html("<div class='well well-sm'><h3>Please login to use lists!</h3></div>");
80             } else {
81                 var html = "";
82                 for(var i=0; i<json.data.length; i++){
83                     html += json.data[i][1]+"\n";
84                 }
85                 jQuery("#transformant_to_new_list").html(html);
86                 addToListMenu("transformant_add_to_list", "transformant_to_new_list", {
87                     selectText: true,
88                     listType: 'accessions',
89                 });
90             }
91         }
93     });
95     jQuery('#custom_barcode_link').click(function() {
96         location.href = '/tools/label_designer';
97     })
99 });
101 </script>