From 4ab72e94c0c93ceb8a946418354d6e62d062e576 Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 20 Jun 2022 09:08:36 +0200 Subject: [PATCH] Add to activated grids and some minor beauty stuff --- application/views/activated_grids/index.php | 4 +-- application/views/gridsquares/index.php | 4 +-- application/views/interface_assets/footer.php | 25 ++++++++++++++++--- application/views/visitor/layout/footer.php | 6 ++--- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/application/views/activated_grids/index.php b/application/views/activated_grids/index.php index a48105ac..56c1b815 100644 --- a/application/views/activated_grids/index.php +++ b/application/views/activated_grids/index.php @@ -25,13 +25,13 @@
uri->segment(2) == "satellites") { ?> uri->segment(2) == "band") { ?> diff --git a/application/views/gridsquares/index.php b/application/views/gridsquares/index.php index e6502443..be52d3ab 100644 --- a/application/views/gridsquares/index.php +++ b/application/views/gridsquares/index.php @@ -25,13 +25,13 @@
uri->segment(2) == "satellites") { ?> uri->segment(2) == "band") { ?> diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 047b172d..55117252 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -1270,14 +1270,14 @@ $(document).ready(function(){ if (grid_four_confirmed_count > 0) { var span = document.getElementById('confirmed_grids'); - span.innerText = span.textContent = '('+grid_four_confirmed_count+' grid squares)'; + span.innerText = span.textContent = '('+grid_four_confirmed_count+' grid square'+(grid_four_confirmed_count != 1 ? 's' : '')+') '; } if ((grid_four_count-grid_four_confirmed_count) > 0) { var span = document.getElementById('worked_grids'); - span.innerText = span.textContent = '('+(grid_four_count-grid_four_confirmed_count)+' grid squares)'; + span.innerText = span.textContent = '('+(grid_four_count-grid_four_confirmed_count)+' grid square'+(grid_four_count-grid_four_confirmed_count != 1 ? 's' : '')+') '; } var span = document.getElementById('sum_grids'); - span.innerText = span.textContent = '| Total Count: '+grid_four_count+' grid squares'; + span.innerText = span.textContent = ' Total Count: '+grid_four_count+' grid square'+(grid_four_count != 1 ? 's' : ''); var maidenhead = L.maidenhead().addTo(map); @@ -1390,10 +1390,29 @@ $(document).ready(function(){ var grid_four = ; var grid_six = ; + var grid_two_count = grid_two.length; + var grid_four_count = grid_four.length; + var grid_six_count = grid_six.length; + var grid_two_confirmed = ; var grid_four_confirmed = ; var grid_six_confirmed = ; + var grid_two_confirmed_count = grid_two_confirmed.length; + var grid_four_confirmed_count = grid_four_confirmed.length; + var grid_six_confirmed_count = grid_six_confirmed.length; + + if (grid_four_confirmed_count > 0) { + var span = document.getElementById('confirmed_grids'); + span.innerText = span.textContent = '('+grid_four_confirmed_count+' grid square'+(grid_four_confirmed_count != 1 ? 's' : '')+') '; + } + if ((grid_four_count-grid_four_confirmed_count) > 0) { + var span = document.getElementById('activated_grids'); + span.innerText = span.textContent = '('+(grid_four_count-grid_four_confirmed_count)+' grid square'+(grid_four_count-grid_four_confirmed_count != 1 ? 's' : '')+') '; + } + var span = document.getElementById('sum_grids'); + span.innerText = span.textContent = ' Total Count: '+grid_four_count+' grid square'+(grid_four_count != 1 ? 's' : ''); + var maidenhead = L.maidenhead().addTo(map); map.on('click', onMapClick); diff --git a/application/views/visitor/layout/footer.php b/application/views/visitor/layout/footer.php index 73aa0c41..f6f37c73 100644 --- a/application/views/visitor/layout/footer.php +++ b/application/views/visitor/layout/footer.php @@ -100,14 +100,14 @@ if (grid_four_confirmed_count > 0) { var span = document.getElementById('confirmed_grids'); - span.innerText = span.textContent = '('+grid_four_confirmed_count+' grid squares)'; + span.innerText = span.textContent = '('+grid_four_confirmed_count+' grid squares) '; } if ((grid_four_count-grid_four_confirmed_count) > 0) { var span = document.getElementById('worked_grids'); - span.innerText = span.textContent = '('+(grid_four_count-grid_four_confirmed_count)+' grid squares)'; + span.innerText = span.textContent = '('+(grid_four_count-grid_four_confirmed_count)+' grid squares) '; } var span = document.getElementById('sum_grids'); - span.innerText = span.textContent = '| Total Count: '+grid_four_count+' grid squares'; + span.innerText = span.textContent = ' Total Count: '+grid_four_count+' grid squares'; var maidenhead = L.maidenhead().addTo(map);