aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/default_settings.py3
-rw-r--r--wqflask/utility/tools.py3
-rwxr-xr-xwqflask/wqflask/templates/index_page_orig.html39
-rw-r--r--wqflask/wqflask/views.py8
4 files changed, 48 insertions, 5 deletions
diff --git a/etc/default_settings.py b/etc/default_settings.py
index 29b96861..ac5dc266 100644
--- a/etc/default_settings.py
+++ b/etc/default_settings.py
@@ -57,7 +57,8 @@ USE_GN_SERVER = 'False' # Use GN_SERVER SQL calls
# Paths to JS libraries
-BIODALLIANCE_JS = os.environ['HOME']+"/genenetwork/biodalliance"
+JS_BIODALLIANCE = os.environ['HOME']+"/genenetwork/biodalliance"
+JS_TWITTER_POST_FETCHER = os.environ['HOME']+"/genenetwork/Twitter-Post-Fetcher"
# ---- Path overrides for Genenetwork
# TMPDIR is normally picked up from the environment
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index 90144962..77cb6ac5 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -232,3 +232,6 @@ if os.environ.get('WQFLASK_OVERRIDES'):
else:
OVERRIDES[k] = cmd
logger.debug(OVERRIDES)
+
+assert_dir(get_setting("JS_BIODALLIANCE"))
+assert_dir(get_setting("JS_TWITTER_POST_FETCHER"))
diff --git a/wqflask/wqflask/templates/index_page_orig.html b/wqflask/wqflask/templates/index_page_orig.html
index 9ac267f1..1694eae5 100755
--- a/wqflask/wqflask/templates/index_page_orig.html
+++ b/wqflask/wqflask/templates/index_page_orig.html
@@ -1,5 +1,10 @@
{% extends "base.html" %}
{% block title %}GeneNetwork{% endblock %}
+{% block css %}
+<style TYPE="text/css">
+ p.interact { display: none; }
+</style>
+{% endblock %}
{% block content %}
<!-- Start of body -->
@@ -166,8 +171,17 @@
</ul>
</section>
</div>
+
<div style="padding-left:120px" class="col-xs-4" style="width: 600px !important;">
- <!--
+ <section id="news-section">
+ <div class="page-header">
+ <h1>News</h1>
+ </div>
+ <div id="tweets"></div>
+ <div align="right">
+ <a href="https://twitter.com/GeneNetwork2">more news items...</a>
+ </div>
+ <!--
<section id="tour-info">
<div class="page-header">
<h1>Tour and more info</h1>
@@ -194,6 +208,7 @@
</section>
-->
+ </section>
<section id="websites">
<div class="page-header">
@@ -220,7 +235,10 @@
UTHSC</li>
</ul>
- </section>
+
+
+
+ </section>
<!--<section id="getting-started">
<div class="page-header">
@@ -281,4 +299,21 @@
}
</script>
+ <script type="text/javascript" src="/twitter/js/twitterFetcher_min.js"></script>
+
+ <script type="text/javascript">
+ var configProfile = {
+ "profile": {"screenName": 'GeneNetwork2'},
+ "domId": 'tweets',
+ "maxTweets": 5,
+ "enableLinks": true,
+ "showUser": false,
+ "showTime": true,
+ "showImages": false,
+ "lang": 'en'
+ };
+ twitterFetcher.fetch(configProfile);
+ </script>
+
+
{% endblock %}
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 23c3757c..289d2dc6 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -145,10 +145,14 @@ def tmp_page(img_path):
return render_template("show_image.html",
img_base64 = bytesarray )
+@app.route("/twitter/<path:filename>")
+def twitter_js(filename):
+ bd_path = app.config['JS_TWITTER_POST_FETCHER']
+ return send_from_directory(bd_path, filename)
@app.route("/dalliance/<path:filename>")
-def bd_files(filename):
- bd_path = app.config['BIODALLIANCE_JS']
+def biodalliance_js(filename):
+ bd_path = app.config['JS_BIODALLIANCE']
return send_from_directory(bd_path, filename)