autogenerated name metadata table
[sgn.git] / mason / transformation / transformation.mas
blobbebc8d14adf15aa48ef6d4d8839b79a3e6c80101
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 $updated_status_type => undef
12 $updated_status_string => undef
13 $identifier_link => undef
14 $project_link
15 $prefix => undef
16 $program_id
17 </%args>
19 <& /util/import_javascript.mas, classes => ["jquery", "jqueryui", "thickbox", "CXGN.Page.FormattingHelpers", "jquery.cookie", "CXGN.List", "jquery.dataTables"] &>
20 <& /util/import_css.mas, paths => ['/documents/inc/datatables/jquery.dataTables.css'] &>
23 <& /page/page_title.mas, title => "Details for transformation '$transformation_name'" &>
26 <&| /page/info_section.mas, title=>"Details",  collapsible => 1, collapsed=>0 &>
28     <div class="panel panel-default">
29         <div class="panel-body">
30             <div class="row">
31                 <div class="col-sm-6">
32                     <table class="table table-bordered table-hover">
33                         <tr><td><b>Plant Material</b></td><td><%$plant_material%></td></tr>
34                         <tr><td><b>Vector Construct</b></td><td><%$vector_construct%></td></tr>
35                         <tr><td><b>Notes</b></td><td><%$transformation_notes%></td></tr>
36                         <tr><td><b>Project</b></td><td><%$project_link%></td></tr>
37                         <tr><td><b>Prefix for Transformant Names</b></td><td><%$prefix%></td></tr>
38 %if ($updated_status_type) {
39                         <tr><td><b>Status</b></td><td><%$updated_status_type%></td></tr>
40                         <tr><td><b>Updated Status Info</b></td><td><%$updated_status_string%></td></tr>
42 %if ($identifier_link) {
43                         <tr><td><b>Tracking Identifier</b></td><td><%$identifier_link%></td></tr>
45                     </table>
46                 </div>
47             </div>
48 %if (!$updated_status_type) {
49             <div class="btn-group"><button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Add New Transformants (Accessions)&nbsp;<span class="caret"></span></button><ul class="dropdown-menu"><li><a href="#" id="add_new_transformants_link">Autogenerated Names</a></li><li><a href="#" id="add_transformants_using_list_link" name="add_transformants_using_list_link">Using a List</a></li><li></ul></div>
50             <button class="btn btn-sm btn-default" style="margin:3px" id="custom_barcode_link">Design Custom Barcodes Using a List</button>
52         </div>
53     </div>
54 </&>
56 <&| /page/info_section.mas, title => 'Transformants (Accessions) Derived from this Transformation ', collapsible=>1, collapsed=>0 &>
57     <div class = "well well-sm">
58         <div class = "panel panel-default">
59             <div class = "panel-body">
60                 <div style="overflow:scroll">
61                     <table class="table table-hover table-bordered" id="transformants_table">
62                         <thead>
63                             <tr>
64                                 <th>Accessions</th>
65                             </tr>
66                         </thead>
67                     </table>
68                 </div>
69                 <div class="panel panel-default">
70                     <div class="panel-body">
71                         <&| /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>'&>
72                             <br>
73                             <div id="transformant_to_new_list" style="display:none"></div>
74                             <div id="transformant_add_to_list"></div>
75                         </&>
76                     </div>
77                 </div>
78             </div>
79         </div>
80     </div>
81 </&>
82 <& /transformation/add_transformant_names_dialog.mas, transformation_id => $transformation_id, transformation_name => $transformation_name, next_new_transformant => $next_new_transformant, last_number => $last_number, prefix => $prefix, program_id => $program_id &>
83 <& /transformation/add_transformants_using_list_dialog.mas, transformation_id => $transformation_id, transformation_name => $transformation_name &>
85 <script>
87 jQuery(document).ready(function(){
88     var transformation_stock_id = "<%$transformation_id%>";
89     var transformants_table = jQuery('#transformants_table').DataTable({
90         'ajax': '/ajax/transformation/transformants/'+transformation_stock_id,
91         'autoWidth': false,
92         "fnInitComplete": function(oSettings, json) {
93             //console.log(json);
94             if (!isLoggedIn()) {
95                 jQuery('#transformant_add_to_list').html("<div class='well well-sm'><h3>Please login to use lists!</h3></div>");
96             } else {
97                 var html = "";
98                 for(var i=0; i<json.data.length; i++){
99                     html += json.data[i][1]+"\n";
100                 }
101                 jQuery("#transformant_to_new_list").html(html);
102                 addToListMenu("transformant_add_to_list", "transformant_to_new_list", {
103                     selectText: true,
104                     listType: 'accessions',
105                 });
106             }
107         }
109     });
111     jQuery('#custom_barcode_link').click(function() {
112         location.href = '/tools/label_designer';
113     })
117 </script>