4 <table class="table table-bordered table-hover" id="raw_drone_image_datatable">
7 <th>Field Trials -> Imaging Events</th>
13 jQuery(document).ready(function(){
15 var raw_drone_imagery_table = jQuery('#raw_drone_image_datatable').DataTable( {
16 'ajax': '/api/drone_imagery/raw_drone_imagery_top',
20 raw_drone_imagery_table.on( 'draw', function () {
22 url : '/api/drone_imagery/raw_drone_imagery_plot_image_count',
23 success: function(response){
24 //console.log(response);
25 jQuery('div[name="drone_run_band_total_plot_image_div"]').html('<div class="panel-group"><div class="panel panel-default"><div class="panel-heading"><h4 class="panel-title"><a data-toggle="collapse" >No Plot Images Saved</a></h4></div></div></div>');
26 for (drone_run_project_id in response.data) {
27 var html = '<div class="panel-group" id="drone_run_plot_polygons_table_accordion_'+drone_run_project_id+'" ><div class="panel panel-default"><div class="panel-heading"><h4 class="panel-title"><a data-toggle="collapse" data-parent="#drone_run_plot_polygons_table_accordion_'+drone_run_project_id+'" href="#drone_run_plot_polygons_table_accordion_one_'+drone_run_project_id+'" >View Plot Images Summary ('+response.data[drone_run_project_id]['total_plot_image_count']+')</a></h4></div><div id="drone_run_plot_polygons_table_accordion_one_'+drone_run_project_id+'" class="panel-collapse collapse"><div class="panel-body">';
28 delete response.data[drone_run_project_id]['total_plot_image_count'];
29 html = html + "<table class='table table-bordered table-sm'><thead><tr><th>Plot Image Type</th><th>Count</th></tr></thead><tbody>";
30 for (plot_image_type in response.data[drone_run_project_id]) {
31 html = html + "<tr><td>" + plot_image_type + "</td><td>" + response.data[drone_run_project_id][plot_image_type] + "</td></tr>";
33 html = html + "</tbody></table>";
34 html = html + '</div></div></div></div>';
35 jQuery('#drone_run_band_total_plot_image_count_div_'+drone_run_project_id).html(html);
38 error: function(response){
39 //alert('Error getting plot image count!')
44 jQuery(document).on('click', 'span[name="drone_image_remove"]', function(){
45 var image_id = jQuery(this).data('image_id');
46 if (confirm("Are you sure you want to remove this image?")) {
48 url : '/api/drone_imagery/remove_image?image_id='+image_id,
49 beforeSend: function() {
50 jQuery("#working_modal").modal("show");
52 success: function(response){
53 console.log(response);
54 jQuery("#working_modal").modal("hide");
57 error: function(response){
58 jQuery("#working_modal").modal("hide");
59 alert('Error removing drone image!')
67 function manageDroneImageryDroneRunBandDisplay(project_drone_run_band_id){
69 url : '/api/drone_imagery/raw_drone_imagery_drone_run_band?drone_run_band_project_id='+project_drone_run_band_id,
70 beforeSend: function() {
71 jQuery("#working_modal").modal("show");
73 success: function(response){
74 console.log(response);
75 jQuery('#drone_run_band_accordian_drone_run_band_div_'+project_drone_run_band_id).html(response.data[0]);
76 jQuery("#working_modal").modal("hide");
78 error: function(response){
79 jQuery("#working_modal").modal("hide");
80 alert('Error getting drone run band summary images!');