5 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery.dataTables' ] &>
6 <& /util/import_css.mas, paths => ['/documents/inc/datatables/jquery.dataTables.css'] &>
9 <div class="modal fade" id="intercross_parents_download_dialog" name="intercross_parents_download_dialog" tabindex="-1" role="dialog" aria-labelledby="intercrossParentsDownloaddialog">
10 <div class="modal-dialog modal-lg" role="document">
11 <div class="modal-content">
12 <div class="modal-header">
13 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
14 <h4 class="modal-title" id="intercrossParentsDownloaddialog">Download Intercross Parents File</h4>
16 <div class="modal-body">
17 <div class="container-fluid">
19 <div class="col-sm-11">
20 <&| /page/explanation.mas, title=>'File Information' &>
22 <b>File Information</b>
24 <a id="intercross_parents_file_info">Intercross Parents</a>
28 <div class="form-horizontal">
29 <div class="form-group">
30 <label class="control-label col-sm-3">Female parents:</label>
31 <div class="col-sm-7" >
32 <div class="input-group">
33 <select class="form-control" id="female_parents_list_select"></select>
37 <div class="form-group">
38 <label class="control-label col-sm-3">Male parents:</label>
39 <div class="col-sm-7" >
40 <div class="input-group">
41 <select class="form-control" id="male_parents_list_select"></select>
50 <div class="modal-footer">
51 <button id="download_intercross_parents_submit" type="button" class="btn btn-primary" >Download</button>
52 <input type="hidden" id="intercross_parents_download_token" name="intercross_parents_download_token"/>
58 <div class="modal fade" id="intercross_parents_download_message" name="intercross_parents_download_message" tabindex="-1" role="dialog" aria-labelledby="intercrossParentsDownloadMessage">
59 <div class="modal-dialog" role="document">
60 <div class="modal-content">
61 <div class="modal-header">
62 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
63 <h4 class="modal-title" id="intercrossParentsDownloadMessage">Intercross Parents File Created</h4>
65 <div class="modal-body">
66 <div class="container-fluid">
68 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
69 The Intercross parents file was created successfully.
72 <a id="intercross_parents_download_link">Download Intercross Parents</a>
76 <div class="modal-footer">
77 <button type="button" class="btn btn-default" name="intercross_parents_download_close_button" id="intercross_parents_download_close_button" data-dismiss="modal">Close</button>
83 <div class="modal fade" id="intercross_parents_file_info_dialog" name="intercross_parents_file_info_dialog" tabindex="-1" role="dialog" aria-labelledby="intercrossParentsFileInfoDialog">
84 <div class="modal-dialog modal-lg" role="document">
85 <div class="modal-content">
86 <div class="modal-header">
87 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
88 <h4 class="modal-title" id="intercrossParentsFileInfoDialog">Intercross Parents</h4>
90 <div class="modal-body">
91 <div class="container-fluid">
93 Names in the list must be uniquenames.
96 Intercross Parents file is a CSV file (.csv).
98 The file can be used directly with Intercross app.
104 The first row (header) contains the following:
106 <table class="table table-bordered table-hover">
119 <li><b>codeId:</b> stock_ids in the database.</li>
120 <li><b>sex:</b> 0 (female), 1 (male)</li>
121 <li><b>name:</b> uniquenames in the database.</li>
125 <div class="modal-footer">
126 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
135 jQuery(document).ready(function(){
137 var crossing_experiment_id = "<% $trial_id %>";
138 var lo = new CXGN.List();
140 jQuery('#female_parents_list_select').html(lo.listSelect('female_parents_list_select', ['accessions'], 'Select a list of female parents', undefined, undefined));
141 jQuery('#male_parents_list_select').html(lo.listSelect('male_parents_list_select', ['accessions'], 'Select a list of male parents', undefined, undefined));
143 jQuery('#download_intercross_parents').click(function(){
144 jQuery('#intercross_parents_download_dialog').modal("show");
147 jQuery("#intercross_parents_file_info").click(function(){
148 jQuery("#intercross_parents_file_info_dialog").modal("show");
151 jQuery('#download_intercross_parents_submit').click(function(){
153 var female_list_id = jQuery('#female_parents_list_select').val();
154 var male_list_id = jQuery('#male_parents_list_select').val();
156 if (!female_list_id) {
157 alert("Please choose a list of female parents");
162 alert("Please choose a list of male parents");
167 url: '/ajax/intercross/create_parents_file',
171 'female_list_id': female_list_id,
172 'male_list_id': male_list_id,
173 'crossing_experiment_id': crossing_experiment_id
175 beforeSend: function() {
176 jQuery("#working_modal").modal("show");
178 success: function(response) {
179 jQuery("#working_modal").modal("hide");
180 if (response.error) {
181 alert(response.error);
183 jQuery('#intercross_parents_download_link').attr('href', "/fieldbook/trait_file_download/" + response.file_id);
184 jQuery("#intercross_parents_download_message").modal("show");
185 jQuery('#intercross_parents_download_dialog').modal("hide");
189 jQuery("#working_modal").modal("hide");
190 alert('An error occurred creating the parents file.');
191 jQuery('#intercross_parents_download_dialog').modal("hide");
196 jQuery("#intercross_parents_download_close_button").click(function(){