3 $autogenerated_name_formats => ()
7 <& /util/import_javascript.mas, classes => [] &>
10 <div class="modal fade" id="set_autogenerated_names_dialog" name="set_autogenerated_names_dialog" tabindex="-1" role="dialog" aria-labelledby="setAutogeneratedNamesDialog">
11 <div class="modal-dialog modal-lg" role="document">
12 <div class="modal-content">
13 <div class="modal-header" style="text-align: center">
14 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
15 <h4 class="modal-title" id="setAutogeneratedNamesDialog">Set Autogenerated Names for Transformants in this Project</h4>
17 <div class="modal-body">
18 <div class="container-fluid">
19 <form class="form-horizontal" id="set_autogenerated_names_form" name="set_autogenerated_names_form">
20 <div class="form-group">
21 <label class="col-sm-5 control-label">Select a format: </label>
22 <div class="col-sm-7">
23 % if ($autogenerated_name_formats) {
24 <select id="name_format_select">
25 <option value="">Please select a naming format</option>
26 % foreach my $name_format(@$autogenerated_name_formats){
27 <option value="<%$name_format%>"><%$name_format%></option>
37 <div class="modal-footer">
38 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
39 <button type="button" class="btn btn-primary" id="set_autogenerated_names_button">Submit</button>
45 <div class="modal fade" id="set_name_saved_dialog_message" name="set_name_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="setNameSavedDialog">
46 <div class="modal-dialog" model-lg role="document">
47 <div class="modal-content">
48 <div class="modal-header">
49 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
50 <h4 class="modal-title" id="setNameSavedDialog">Success</h4>
52 <div class="modal-body">
53 <div class="container-fluid">
55 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
56 Naming format has been set for this project.
60 <div class="modal-footer">
61 <button id="dismiss_set_name_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
70 jQuery(document).ready(function(){
72 let project_id = "<%$trial_id%>";
73 let autogenerated_name_formats = "<%$autogenerated_name_formats%>";
74 let program_name = "<%$breeding_program_name%>";
76 jQuery('#set_autogenerated_names_link').click(function() {
77 if (autogenerated_name_formats !== "") {
78 jQuery("#set_autogenerated_names_dialog").modal("show");
80 alert('Please set up autogenerated name format for your breeding program first')
84 jQuery('#set_autogenerated_names_button').click(function(){
86 let name_format = jQuery('#name_format_select').val();
88 alert("Please select a name format");
93 url : '/ajax/transformation/set_autogenerated_name_format',
97 'project_id': project_id,
98 'name_format': name_format,
99 'program_name': program_name,
101 success: function(response){
102 console.log(response);
104 alert(response.error);
106 if (response.success == 1) {
107 jQuery('#set_autogenerated_names_dialog').modal('hide');
108 jQuery('#set_name_saved_dialog_message').modal("show");
111 error: function(response){
112 alert('Error storing autogenerated name format!');
117 jQuery("#dismiss_set_name_saved_dialog").click(function(){
118 jQuery('#name_format_select').val('');