customized field headers
[sgn.git] / mason / transformation / transformation.mas
blob282b49565da2a5ca14c042674b58fe4c35f9df7d
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 </%args>
17 <& /util/import_javascript.mas, classes => ["jquery", "jqueryui", "thickbox", "CXGN.Page.FormattingHelpers", "jquery.cookie", "CXGN.List", "jquery.dataTables"] &>
18 <& /util/import_css.mas, paths => ['/documents/inc/datatables/jquery.dataTables.css'] &>
21 <& /page/page_title.mas, title => "Details for transformation '$transformation_name'" &>
24 <&| /page/info_section.mas, title=>"Details",  collapsible => 1, collapsed=>0 &>
26     <div class="panel panel-default">
27         <div class="panel-body">
28             <div class="row">
29                 <div class="col-sm-6">
30                     <table class="table table-bordered table-hover">
31                         <tr><td><b>Plant Material</b></td><td><%$plant_material%></td></tr>
32                         <tr><td><b>Vector Construct</b></td><td><%$vector_construct%></td></tr>
33                         <tr><td><b>Notes</b></td><td><%$transformation_notes%></td></tr>
34                         <tr><td><b>Project</b></td><td><%$project_link%></td></tr>                        
35 %if ($updated_status_type) {
36                         <tr><td><b>Status</b></td><td><%$updated_status_type%></td></tr>
37                         <tr><td><b>Updated Status Info</b></td><td><%$updated_status_string%></td></tr>
39 %if ($identifier_link) {
40                         <tr><td><b>Tracking Identifier</b></td><td><%$identifier_link%></td></tr>
42                     </table>
43                 </div>
44             </div>
45 %if (!$updated_status_type) {
46             <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">Use 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>
47             <button class="btn btn-sm btn-default" style="margin:3px" id="custom_barcode_link">Design Custom Barcodes Using a List</button>
49         </div>
50     </div>
51 </&>
53 <&| /page/info_section.mas, title => 'Transformants (Accessions) Derived from this Transformation ', collapsible=>1, collapsed=>0 &>
54     <div class = "well well-sm">
55         <div class = "panel panel-default">
56             <div class = "panel-body">
57                 <div style="overflow:scroll">
58                     <table class="table table-hover table-bordered" id="transformants_table">
59                         <thead>
60                             <tr>
61                                 <th>Accessions</th>
62                             </tr>
63                         </thead>
64                     </table>
65                 </div>
66                 <div class="panel panel-default">
67                     <div class="panel-body">
68                         <&| /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>'&>
69                             <br>
70                             <div id="transformant_to_new_list" style="display:none"></div>
71                             <div id="transformant_add_to_list"></div>
72                         </&>
73                     </div>
74                 </div>
75             </div>
76         </div>
77     </div>
78 </&>
79 <& /transformation/add_transformant_names_dialog.mas, transformation_id => $transformation_id, transformation_name => $transformation_name, next_new_transformant => $next_new_transformant, last_number => $last_number  &>
80 <& /transformation/add_transformants_using_list_dialog.mas, transformation_id => $transformation_id, transformation_name => $transformation_name &>
82 <script>
84 jQuery(document).ready(function(){
85     var transformation_stock_id = "<%$transformation_id%>";
86     var transformants_table = jQuery('#transformants_table').DataTable({
87         'ajax': '/ajax/transformation/transformants/'+transformation_stock_id,
88         'autoWidth': false,
89         "fnInitComplete": function(oSettings, json) {
90             //console.log(json);
91             if (!isLoggedIn()) {
92                 jQuery('#transformant_add_to_list').html("<div class='well well-sm'><h3>Please login to use lists!</h3></div>");
93             } else {
94                 var html = "";
95                 for(var i=0; i<json.data.length; i++){
96                     html += json.data[i][1]+"\n";
97                 }
98                 jQuery("#transformant_to_new_list").html(html);
99                 addToListMenu("transformant_add_to_list", "transformant_to_new_list", {
100                     selectText: true,
101                     listType: 'accessions',
102                 });
103             }
104         }
106     });
108     jQuery('#custom_barcode_link').click(function() {
109         location.href = '/tools/label_designer';
110     })
114 </script>