5 <& /page/page_title.mas, title=>"Download Using Lists" &>
7 <div class="container-fluid">
10 Choose a list for each parameter and click "Download".
13 <div class="well well-sm">
14 <form id="download_form" action="/breeders/download_action" method="POST" >
15 <table class="table" cellpadding="10" border="0" >
17 <tr><td colspan="4"><h4>Download Phenotype</h4><p>Select parameter:</p></tr>
42 <div id="accession_list">
54 <div class="checkbox">
55 <label><input type="checkbox" id="format" name="format" value=".xls">.xls (default)</label>
57 <div class="checkbox">
58 <label><input type="checkbox" id="format" name="format" value=".csv">.csv</label>
60 <div class="checkbox">
61 <label><input type="checkbox" id="format" name="format" value="html">html</label>
65 <select class="form-control" id="timestamp" name="timestamp">
66 <option value="0">No</option>
67 <option value="1">Yes</option>
71 <input class="btn btn-primary" type="button" id="phenotype" value="Download" />
72 <input type="hidden" id="download_token_value" name="download_token_value"/>
81 $(document).ready(function() {
83 var lo = new CXGN.List();
85 $('#accession_list').html(lo.listSelect('accession_list', [ 'accessions' ], 'select'));
86 $('#trial_list').html(lo.listSelect('trial_list', [ 'trials' ], 'select' ));
87 $('#trait_list').html(lo.listSelect('trait_list', [ 'traits' ], 'select' ));
89 $('#phenotype').click(function() {
93 var accession_list_id = $('#accession_list_list_select').val();
94 var trial_list_id = $('#trial_list_list_select').val();
95 var trait_list_id = $('#trait_list_list_select').val();
97 var accession_validation = 1;
98 if (accession_list_id) { accession_validation = lo.validate(accession_list_id, 'accessions', true); }
100 var trial_validation = 1;
101 if (trial_list_id) { trial_validation = lo.validate(trial_list_id, 'trials', true); }
103 var trait_validation = 1;
104 if (trait_list_id) { trait_validation = lo.validate(trait_list_id, 'traits', true); }
106 if (!accession_list_id || !trial_list_id || !trait_list_id) {
108 alert("You need to select an accession, a trial, and a trait list!");
112 var problem_lists = new Array();
114 if (accession_validation != 1) {
115 problem_lists.push('accessions');
117 if (trial_validation != 1) {
118 problem_lists.push('trials');
120 if (trait_validation != 1) {
121 problem_lists.push('trials');
124 if (problem_lists.length > 0) {
126 alert("The following lists did not pass validation: "+problem_lists.join(", ")+". Please correct the list(s) and try again");
130 var token = new Date().getTime(); //use the current timestamp as the token value
131 $('#download_token_value').val(token);
133 $('#download_form').submit();
135 var fileDownloadCheckTimer;
136 fileDownloadCheckTimer = window.setInterval(function () { //checks for response cookie to keep working modal enabled until file is ready for download
137 var cookieValue = $.cookie('fileDownloadToken');
138 if (cookieValue == token) {
139 window.clearInterval(fileDownloadCheckTimer);
140 jQuery.removeCookie('fileDownloadToken'); //clears this cookie value
146 function disable_ui() {
147 $('#working_modal').modal("show");
150 function enable_ui() {
151 $('#working_modal').modal("hide");
158 <!-- start of code for pedigree download -->
160 <div class="well well-sm">
161 <form id="download_pedigree" action="/breeders/download_pedigree_action" method="POST">
162 <table class="table" cellpadding="10">
164 <tr><td colspan="2"><h4>Download Pedigree </h4><p>Select parameter:</p></tr>
177 <div id="accession_list4">
181 <input class="btn btn-primary" type="button" id="pedigree" value="Download" />
191 $(document).ready(function() {
193 var lo = new CXGN.List();
195 $('#accession_list4').html(lo.listSelect('pedigree_accession_list', [ 'accessions' ], 'select'));
197 $('#pedigree').click(function() {
201 var accession_list_id = $('#pedigree_accession_list_list_select').val();
202 var trial_list_id = $('#genotype_trial_list_list_select').val();
205 var accession_validation = 1;
206 if (accession_list_id) {
207 accession_validation = lo.validate(accession_list_id, 'accessions', true);
211 if (! accession_list_id) {
212 alert("You need to select an accession!");
216 var problem_lists = new Array();
218 if (accession_validation != 1) {
219 problem_lists.push('accessions');
222 console.log(problem_lists);
224 if (problem_lists.length > 0) {
225 alert("The following lists did not pass validation: "+problem_lists.join(", ")+". Please correct the list(s) and try again");
229 jQuery('#download_pedigree').submit();
235 function disable_ui() {
236 $('#working_modal').modal("show");
239 function enable_ui() {
240 $('#working_modal').modal("hide");
247 <!-- end of code for pedigree download -->
250 <div class="well well-sm">
251 <form id="download_gbs" action="/breeders/download_gbs_action" method="POST">
252 <table class="table" cellpadding="10">
254 <tr><td colspan="2"><h4>Download GBS Genotype </h4><p>Select parameter:</p></tr>
270 <div id="accession_list2">
274 <div id="protocol_list">
278 <input class="btn btn-primary" type="button" id="genotype" value="Download" />
287 $(document).ready(function() {
289 var lo = new CXGN.List();
291 $('#accession_list2').html(lo.listSelect('genotype_accession_list', [ 'accessions' ], 'select'));
292 get_select_box("genotyping_protocols", "protocol_list");
294 $('#genotype').click(function() {
298 var accession_list_id = $('#genotype_accession_list_list_select').val();
299 var protocol_list_id = $('#protocol_list').val();
301 var accession_validation = 1;
302 if (accession_list_id) {
303 accession_validation = lo.validate(accession_list_id, 'accessions', true);
306 if (!( accession_list_id || protocol_list_id) ) {
307 alert("You need to select a list of accessions and a protocol !");
311 var problem_lists = new Array();
313 if (accession_validation != 1) {
314 problem_lists.push('accessions');
318 console.log(problem_lists);
320 if (problem_lists.length > 0) {
321 alert("The following lists did not pass validation: "+problem_lists.join(", ")+". Please correct the list(s) and try again");
325 jQuery('#download_gbs').submit();
332 function disable_ui() {
333 $('#working_modal').modal("show");
336 function enable_ui() {
337 $('#working_modal').modal("hide");
343 <div class="well well-sm">
344 <form id="gbs_qc" action="/breeders/gbs_qc_action" method="POST">
345 <table class="table" cellpadding="10">
347 <tr><td colspan="3"><h4>GBS Genotype QC</h4><p>Select parameter:</p></tr>
363 <div id="trial_list3">
367 <div id="accession_list3">
371 <input class="btn btn-primary" type="button" id="genotype_qc" value="Quality Control" />
382 $(document).ready(function() {
384 var lo = new CXGN.List();
386 $('#accession_list3').html(lo.listSelect('genotype_qc_accession_list', [ 'accessions' ], 'select'));
387 $('#trial_list3').html(lo.listSelect('genotype_trial_list', [ 'trials' ], 'select' ));
389 $('#genotype_qc').click(function() {
391 $('#working').dialog( {
399 open: function() { $(this).closest('.ui-dialog').find('.ui-dialog-titlebar-close').hide(); },
400 title: 'Downloading genotype...'
405 var accession_list_id = $('#genotype_accession_list_list_select').val();
406 var trial_list_id = $('#genotype_trial_list_list_select').val();
408 var accession_validation = lo.validate(accession_list_id, 'accessions', true);
409 var trial_validation = lo.validate(trial_list_id, 'trials', true);
411 if (! (accession_list_id || trial_list_id) ) {
412 alert("You need to select an accession or a trail !");
416 var problem_lists = new Array();
418 if (accession_validation != 1) {
419 problem_lists.push('accessions');
422 if (trial_validation != 1) {
423 problem_lists.push('trials');
427 //alert("problem_lists is " + problem_lists);
429 console.log(problem_lists);
431 if (problem_lists.length > 0) {
432 alert("The following lists did not pass validation: "+problem_lists.join(", ")+". Please correct the list(s) and try again");
436 jQuery('#gbs_qc').submit();
445 function disable_ui() {
446 $('#working_modal').modal("show");
449 function enable_ui() {
450 $('#working_modal').modal("hide");