about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPjotr Prins2016-06-23 06:51:47 +0000
committerPjotr Prins2016-06-23 06:51:47 +0000
commit78e9c2d2d67302b728735b90a56fa1824c1ee447 (patch)
tree1948444af02c4fbc0926c07e9f49162f136d99d5
parent7d1daf02fad08abdece2e9b684e4ee7aff4c2b13 (diff)
downloadgenenetwork2-78e9c2d2d67302b728735b90a56fa1824c1ee447.tar.gz
Pass GN_SERVER_URL into Javascript renderer of menu
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_select_menu.js2
-rw-r--r--wqflask/wqflask/templates/index_page.html20
-rw-r--r--wqflask/wqflask/views.py4
3 files changed, 15 insertions, 11 deletions
diff --git a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js
index d4110e11..43b0960c 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js
+++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js
@@ -4,7 +4,7 @@ $(function() {
         populate_species();
         return apply_default();
     };
-  $.getJSON("http://localhost:8880/int/menu/main.json",
+  $.getJSON(gn_server_url+"/int/menu/main.json",
   function(data) {
     gndata = data;
     console.log("***** GOT DATA from GN_SERVER ****");
diff --git a/wqflask/wqflask/templates/index_page.html b/wqflask/wqflask/templates/index_page.html
index 9e029911..dc7e058c 100644
--- a/wqflask/wqflask/templates/index_page.html
+++ b/wqflask/wqflask/templates/index_page.html
@@ -7,15 +7,15 @@
     <header class="jumbotron subhead" id="overview">
         <div class="container">
             <h1>GeneNetwork</h1>
-            <p class="lead">Open source bioinformatics for systems genetics</p>   
+            <p class="lead">Open source bioinformatics for systems genetics</p>
         </div>
     </header>
 -->
 
     <div class="container-fluid">
-        
+
         {{ flash_me() }}
-        
+
         <div class="row" style="width: 1400px !important;">
 
             <div class="col-xs-5">
@@ -90,7 +90,7 @@
                                 <!--  GET ANY HELP   -->
                                 <div class="form-group">
                                     <label for="btsearch" class="col-xs-1 control-label" style="width: 65px !important;"></label>
-                                    <div class="col-xs-10 controls">                                  
+                                    <div class="col-xs-10 controls">
                                         <div class="col-xs-12 controls">
                                             Enter terms, genes, ID numbers in the <b>Search</b> field.<br>
                                             Use <b>*</b> or <b>?</b> wildcards (Cyp*a?, synap*).<br>
@@ -113,7 +113,7 @@
                                     <div class="col-xs-10 controls">
                                         <div class="col-xs-2 controls" style="width: 100px !important;">
                                             <input id="btsearch" type="submit" class="btn btn-primary form-control" value="Search">
-                                        </div>                                    
+                                        </div>
                                     </div>
                                 </div>
 
@@ -267,15 +267,19 @@
 {%endblock%}
 
 {% block js %}
+
+    <script>
+      gn_server_url = "{{ gn_server_url }}";
+    </script>
     <script src="/static/new/javascript/dataset_select_menu.js"></script>
 
     <script>
         function pressed(e) {
             // Has the enter key been pressed?
-            if ( (window.event ? event.keyCode : e.which) == 13) { 
+            if ( (window.event ? event.keyCode : e.which) == 13) {
                 // If enter key has been pressed and the search fields are non-empty
-								// manually submit the <form>			 
-								if( event.target.value.trim() != "" ) {										
+								// manually submit the <form>
+								if( event.target.value.trim() != "" ) {
 									document.forms[1].submit();
 								}
             }
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 108a70a0..83aa7d84 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -48,7 +48,7 @@ from wqflask.wgcna import wgcna_analysis
 from wqflask.ctl import ctl_analysis
 
 from utility import temp_data
-from utility.tools import TEMPDIR,USE_REDIS,USE_GN_SERVER
+from utility.tools import TEMPDIR,USE_REDIS,USE_GN_SERVER,GN_SERVER_URL
 
 from base import webqtlFormData
 from base.webqtlConfig import GENERATED_IMAGE_DIR
@@ -76,7 +76,7 @@ def index_page():
     logger.info("Sending index_page")
     if USE_GN_SERVER:
         # The menu is generated using GN_SERVER
-        return render_template("index_page.html")
+        return render_template("index_page.html", gn_server_url = GN_SERVER_URL)
     else:
         # Old style static menu (OBSOLETE)
         return render_template("index_page_orig.html")