4 <& /util/import_javascript.mas, classes => [ ] &>
6 <!--button class='btn btn-default' style='margin:3px' id='export_drone_imagery_events'>Export Imaging Events</button-->
8 <div class="modal fade" id="export_drone_imagery_dialog" name="export_drone_imagery_dialog" tabindex="-1" role="dialog" aria-labelledby="exportDroneImageryDialog">
9 <div class="modal-dialog modal-xl" role="document">
10 <div class="modal-content">
11 <div class="modal-header">
12 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
13 <h4 class="modal-title" id="exportDroneImageryDialog">Export Aerial Imaging Event(s)</h4>
15 <div class="modal-body">
16 <div class="container-fluid">
18 <&| /util/workflow.mas, id=> "drone_imagery_export_workflow" &>
19 <&| /util/workflow.mas:step, title=> "Intro" &>
20 <& /page/page_title.mas, title=>"This workflow will guide you through exporting aerial imaging event(s) from the database" &>
22 <li>Exporting imaging events is important for transferring data across ImageBreed instances.</li>
23 <li>Exporting imaging events will return a spreadsheet file defining the imaging events, a zipfile containing the orthophoto imges, and a zipfile containing the GeoJSON plot-polygon definitions.</li>
24 <li>Phenotypic values will not be exported in this workflow, please use the Wizard of the "Download Image-Phenotype File" to retrieve phenotypic values.</li>
28 <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to export imaging event(s)</button>
31 <&| /util/workflow.mas:step, title=> "Field Trial" &>
32 <& /page/page_title.mas, title=>"Select your field trial" &>
34 <div class="form-horizontal">
35 <div class="form-group">
36 <label class="col-sm-3 control-label">Field Trial: </label>
37 <div class="col-sm-9" >
38 <div id="export_drone_image_trial_select_div"></div>
45 <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
48 <&| /util/workflow.mas:step, title=> "Drone Run" &>
49 <& /page/page_title.mas, title=>"Create a new drone run" &>
51 <table class="table table-bordered table-hover" id="drone_image_export_drone_runs_table">
55 <th>Imaging Event Name</th>
56 <th>Imaging Event Type</th>
57 <th>Imaging Event Description</th>
58 <th>Imaging Event Date</th>
59 <th>Drone Run GDD</th>
61 <th>Field Trial Name</th>
62 <th>Field Trial Description</th>
68 <button class="btn btn-primary" id="drone_image_export_drone_run_continue">Go to Next Step</button>
71 <&| /util/workflow.mas:step, title=> "Submit" &>
72 <& /page/page_title.mas, title=>"Export Imaging Event(s)" &>
74 <div id="export_drone_imagery_submit_div">
78 <button type="button" class="btn btn-info" name="export_drone_imagery_submit" id="export_drone_imagery_submit">Submit</button>
84 <div id="upload_drone_imagery_verify_status"></div>
87 <div class="modal-footer">
88 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
94 <script defer="defer">
96 jQuery(document).ready(function() {
98 jQuery('#export_drone_imagery_events').on('click', function(){
99 jQuery('#export_drone_imagery_dialog').modal('show');
102 get_select_box('trials', 'export_drone_image_trial_select_div', { 'name' : 'export_drone_run_field_trial_id', 'id' : 'export_drone_run_field_trial_id', 'empty':1, 'multiple':0 });
104 var export_imaging_events_field_trial_id;
105 jQuery(document).on('change', '#export_drone_run_field_trial_id', function() {
106 export_imaging_events_field_trial_id = jQuery(this).val();
107 jQuery('#drone_image_export_drone_runs_table').DataTable({
109 ajax : '/api/drone_imagery/drone_runs?select_checkbox_name=export_drone_imagery_drone_run_select&field_trial_ids='+export_imaging_events_field_trial_id
113 var export_imaging_events_drone_run_ids = [];
114 jQuery('#drone_image_export_drone_run_continue').click(function(){
115 export_imaging_events_drone_run_ids = [];
116 jQuery('input[name="export_drone_imagery_drone_run_select"]:checked').each(function() {
117 export_imaging_events_drone_run_ids.push(jQuery(this).val());
119 if (export_imaging_events_drone_run_ids.length < 1) {
120 alert('Please select at least one imaging event.');
124 Workflow.complete('#drone_image_export_drone_run_continue');
125 Workflow.focus('#drone_imagery_export_workflow', 3);
131 jQuery('#export_drone_imagery_submit').click(function(){
133 url : '/api/drone_imagery/export_drone_runs?drone_run_project_ids='+JSON.stringify(export_imaging_events_drone_run_ids)+'&field_trial_id='+export_imaging_events_field_trial_id,
134 success: function(response){
135 console.log(response);
137 if (response.error) {
138 alert(response.error);
142 var html = '<a href="'+response.imaging_events_spreadsheet+'">Download Imaging Event Spreadsheet</a><hr><a href="'+response.orthoimage_zipfile+'">Download Orthoimage Zipfile</a><hr><a href="'+response.geojson_zipfile+'">Download GeoJSON Zipfile</a>';
143 jQuery('#export_drone_imagery_submit_div').html(html);
147 error: function(response){
148 alert('Error exporting imaging events!');