10 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery.dataTables' ] &>
11 <& /util/import_css.mas, paths => ['/documents/inc/datatables/jquery.dataTables.css'] &>
13 <div class="modal fade" id="add_new_transformant_names_dialog" name="add_new_transformant_names_dialog" tabindex="-1" role="dialog" aria-labelledby="addNewTransformantNamesDialog">
14 <div class="modal-dialog modal-lg" role="document">
15 <div class="modal-content">
16 <div class="modal-header" style="text-align: center">
17 <button type="reset" class="close" id="add_new_transformants_dismiss_button_1" name="add_new_transformants_dismiss_button" aria-label="Close"><span aria-hidden="true">×</span></button>
18 <h4 class="modal-title" id="addNewTransformantNamesDialog">Add New Transformant (Accession) Names</h4>
20 <div class="modal-body">
21 <div class="container-fluid">
22 <form class="form-horizontal" id="create_new_transformants_form" name="create_new_transformants_form">
23 <div class="form-group">
24 <label class="col-sm-3 control-label">Prefix: </label>
25 <div class="col-sm-9">
26 <input class="form-control" id="autogenerated_name_prefix" name="autogenerated_name_prefix" type="text" disabled value="<%$prefix%>"/>
30 <div class="form-group">
31 <label class="col-sm-3 control-label">Next Name: </label>
32 <div class="col-sm-9">
33 <input class="form-control" id="next_transformant_name" name="next_transformant_name" type="text" disabled value="<%$next_new_transformant%>"/>
37 <div class="form-group">
38 <label class="col-sm-3 control-label">How many?</label>
39 <div class="col-sm-9">
40 <input class="form-control" id="number_of_new_transformants" name="number_of_new_transformants" type="number" />
46 <div class="modal-footer">
47 <button id="add_new_transformants_dismiss_button_2" name="add_new_transformants_dismiss_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
48 <button type="button" class="btn btn-primary" id="new_transformants_submit">Submit</button>
54 <div class="modal fade" id="new_transformants_saved_dialog_message" name="new_transformants_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="newTransformantsSavedDialog">
55 <div class="modal-dialog" role="document">
56 <div class="modal-content">
57 <div class="modal-header">
58 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
59 <h4 class="modal-title" id="newTransformantsSavedDialog">Success</h4>
61 <div class="modal-body">
62 <div class="container-fluid">
64 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
65 The new transformants (accessions) were saved successfully.
69 <div class="modal-footer">
70 <button id="dismiss_new_transformants_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close & Reload</button>
79 jQuery(document).ready(function(){
81 var last_number = "<% $last_number %>";
82 var prefix = "<% $prefix %>";
84 jQuery('#add_new_transformants_link').click(function(){
86 jQuery('#add_new_transformant_names_dialog').modal('show');
88 alert('Please set Prefix for autogenerated names for this project first. You can find Set Autogenerated Names link on the project page')
92 jQuery('#new_transformants_submit').click(function(){
93 var new_name_count = jQuery('#number_of_new_transformants').val();
95 url : '/ajax/transformation/add_transformants',
99 // 'transformation_name': "<%$transformation_name%>",
100 'transformation_stock_id': "<%$transformation_id%>",
101 'program_id': "<%$program_id%>",
103 'new_name_count': new_name_count,
104 // 'last_number': last_number,
106 beforeSend: function(response){
107 jQuery('#working_modal').modal('show');
109 success: function(response) {
110 jQuery('#working_modal').modal('hide');
111 if (response.success == 1) {
112 jQuery('#add_new_transformant_names_dialog').modal('hide');
113 jQuery('#new_transformants_saved_dialog_message').modal("show");
116 if (response.error) {
117 alert(response.error);
120 error: function(response){
121 jQuery('#working_modal').modal('hide');
122 alert('An error occurred creating new transformants');
127 jQuery("[name='add_new_transformants_dismiss_button']").click(function() {
128 jQuery('#add_new_transformant_names_dialog').modal('hide');
129 jQuery('#number_of_new_transformants').val('');
132 jQuery("#dismiss_new_transformants_saved_dialog").click(function(){
133 jQuery('#number_of_new_transformants').val('');