From bdff2b74b03d50f5781f41fd5a7ec4a4f244d2d2 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 29 Aug 2018 10:28:32 +0200 Subject: [PATCH] statistics.html: Add option to hide hoods by type (V1/V2/local) Signed-off-by: Adrian Schmutzler --- ffmap/web/templates/statistics.html | 34 +++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/ffmap/web/templates/statistics.html b/ffmap/web/templates/statistics.html index 9de6937..92f1ce1 100644 --- a/ffmap/web/templates/statistics.html +++ b/ffmap/web/templates/statistics.html @@ -52,7 +52,7 @@
-
Hoods
+
Hoods - V1: On, V2: On, Local: On
@@ -69,7 +69,7 @@ {%- for hoodid, value in hoods|dictsort %} - + @@ -276,6 +276,36 @@ {"orderable": false, "targets": -1}, ] }); + + function enableHood(aid,classname) { + var avx = document.getElementById(aid) + var rows = document.getElementsByClassName(classname) + if(avx.text=="On") { + avx.text = "Off"; + for (var i = 0; i < rows.length; i++) { + rows[i].style.display = 'none'; + } + } else { + avx.text = "On"; + for (var i = 0; i < rows.length; i++) { + rows[i].style.display = ''; + } + } + return true + } + + document.getElementById("enablev1").onclick = function() { + enableHood("enablev1","rowv1") + return false; + } + document.getElementById("enablev2").onclick = function() { + enableHood("enablev2","rowv2") + return false; + } + document.getElementById("enablelocal").onclick = function() { + enableHood("enablelocal","rowlocal") + return false; + } }); {% endblock %}
{{ value['name'] }} {{ hoods_gws[hoodid] or "-" }} {{ value["online"] or 0 }}