diff display_issues.py @ 25:7161ce4e7ab1

The web-based display is dynamically generated. * All graphs are passed in one object. All graphs are passed in one object. The graphs are generated iteratiev and assigned a color. * roundup_cc.py can count how many issues are in which state.
author Magnus Schieder <mschieder@intevation.de>
date Mon, 12 Nov 2018 18:03:26 +0100
parents 89469aa41fe1
children
line wrap: on
line diff
--- a/display_issues.py	Fri Nov 02 17:06:45 2018 +0100
+++ b/display_issues.py	Mon Nov 12 18:03:26 2018 +0100
@@ -51,15 +51,16 @@
     if "None" not in columns:
         data_dict["None"] = [0]
 
+
+    js_data_dickt ="{"
+    for col in columns.split(", "):
+        js_data_dickt += col + ":[" + make_js_object_string(data_dict[col]) + "],"
+    js_data_dickt += "}"
+
     base_html_data = (base_html_data
         .replace("status", status)
         .replace("keywords", keywords)
-        .replace("var critical=[];", "var critical=[" + make_js_object_string(data_dict["critical"]) + "]")
-        .replace("var urgent=[];", "var urgent=[" + make_js_object_string(data_dict["urgent"]) + "]")
-        .replace("var bug=[];", "var bug=[" + make_js_object_string(data_dict["bug"]) + "]")
-        .replace("var feature=[];", "var feature=[" + make_js_object_string(data_dict["feature"]) + "]")
-        .replace("var wish=[];", "var wish=[" + make_js_object_string(data_dict["wish"]) + "]")
-        .replace("var noPrio=[];", "var noPrio=[" + make_js_object_string(data_dict["None"]) + "]")
+        .replace("js_data_dickt", js_data_dickt)
         .replace("var timestamp=[];", "var timestamp=[" + make_js_object_date(data_dict["date"]) + "]"))
 
     return base_html_data
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)