From 82f70e61f4c09443c416faba4848df5749ada8ee Mon Sep 17 00:00:00 2001 From: Mokaddem Date: Mon, 15 Aug 2016 15:16:31 +0200 Subject: [PATCH] Added provider checkbox --- var/www/Flask_server.py | 18 +++++++++++++-- .../sentiment_analysis_plot_tool.html | 23 +++++++++++-------- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/var/www/Flask_server.py b/var/www/Flask_server.py index 94abfbcd..2cd57db5 100755 --- a/var/www/Flask_server.py +++ b/var/www/Flask_server.py @@ -468,13 +468,27 @@ def sentiment_analysis_getplotdata(): - - @app.route("/sentiment_analysis_plot_tool/") def sentiment_analysis_plot_tool(): return render_template("sentiment_analysis_plot_tool.html") + +@app.route("/sentiment_analysis_plot_tool_getdata/") +def sentiment_analysis_plot_tool_getdata(): + getProviders = request.args.get('getProviders') + + if getProviders: + providers = [] + for cur_provider in r_serv_charts.smembers('providers_set'): + providers.append(cur_provider) + return jsonify(providers) + + else: + return 0 + + + @app.route("/showsavedpaste/") #completely shows the paste in a new tab def showsavedpaste(): return showpaste(0) diff --git a/var/www/templates/sentiment_analysis_plot_tool.html b/var/www/templates/sentiment_analysis_plot_tool.html index 5c9c630f..9309f459 100644 --- a/var/www/templates/sentiment_analysis_plot_tool.html +++ b/var/www/templates/sentiment_analysis_plot_tool.html @@ -75,21 +75,13 @@
-
    -
  • -
  • -
  • -
  • +
-
    -
  • -
  • -
  • -
  • +
@@ -147,6 +139,17 @@ $(document).ready(function(){ activePage = $('h1.page-header').attr('data-page'); $("#"+activePage).addClass("active"); + var li_text = "
  • " + + $.getJSON('/sentiment_analysis_plot_tool_getdata/?getProviders=True', function(data){ + console.log(data); + for(i=0; i