aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2021-11-08 05:02:36 +0300
committerFrederick Muriuki Muriithi2021-11-08 05:02:36 +0300
commitd905866c9a025f6af4d08432d978349ab09348c0 (patch)
tree8fe29cd7aaeeee28124f3dfd504053a38920c537
parent990d2e4305ed89c2bc78ff370b71a3a4f68e5f01 (diff)
downloadgenenetwork2-d905866c9a025f6af4d08432d978349ab09348c0.tar.gz
Build UI for Jupyter Notebooks Launcher
* Build a HTML UI for the Jupyter Notebooks Launcher feature that fits in, aesthetically, with that of the whole GeneNetwork look and feel.
-rw-r--r--wqflask/wqflask/jupyter_notebooks.py21
-rw-r--r--wqflask/wqflask/templates/jupyter_notebooks.html24
2 files changed, 45 insertions, 0 deletions
diff --git a/wqflask/wqflask/jupyter_notebooks.py b/wqflask/wqflask/jupyter_notebooks.py
new file mode 100644
index 00000000..c7d5ffa3
--- /dev/null
+++ b/wqflask/wqflask/jupyter_notebooks.py
@@ -0,0 +1,21 @@
+from Flask import BluePrint, render_template
+
+jupyter_notebooks = Blueprint('jupyter_notebooks', __name__)
+
+@jupyter_notebooks.route("/jupyter-notebooks-launcher", methods=("GET",))
+def jupyter_notebooks_launcher():
+ links = (
+ {
+ "main_url": "http://notebook.genenetwork.org/51091/tree?",
+ "notebook_name": "COVID-19 in mybinder.org federation",
+ "src_link_url": "https://github.com/jgarte/covid19_in_binder"},
+ {
+ "main_url": "http://notebook.genenetwork.org/35639/tree?",
+ "notebook_name": "Simple requirements.txt based example",
+ "src_link_url": "https://github.com/jgarte/requirements"},
+ {
+ "main_url": "http://notebook.genenetwork.org/40733/tree?",
+ "notebook_name": "Guile Jupyter Notebook Querying GeneNetwork API",
+ "src_link_url": "https://github.com/jgarte/guile-notebook-genenetwork-api"})
+
+ return render_template("jupyter_notebooks.html", links=links)
diff --git a/wqflask/wqflask/templates/jupyter_notebooks.html b/wqflask/wqflask/templates/jupyter_notebooks.html
new file mode 100644
index 00000000..4dce0f27
--- /dev/null
+++ b/wqflask/wqflask/templates/jupyter_notebooks.html
@@ -0,0 +1,24 @@
+{%extends "base.html"%}
+
+{%block title%}
+Jupyter Notebooks
+{%endblock%}
+
+{%block content%}
+
+<div class="container">
+ <h1>Current Notebooks</h1>
+
+ {%for item in links:%}
+ <div class="jupyter-links">
+ <a href="{{item.get('main_url')}}"
+ title="Access running notebook for '{{item.get('notebook_name')}}' on GeneNetwork"
+ class="main-link">{{item.get("notebook_name")}}</a>
+ <a href="{{item.get('src_link_url')}}"
+ title="Link to the notebook repository for {{item.get('notebook_name', '_')}}"
+ class="src-link">View Source</a>
+ </div>
+ {%endfor%}
+</div>
+
+{%endblock%}