diff options
-rw-r--r-- | wqflask/wqflask/markdown_routes.py | 33 | ||||
-rw-r--r-- | wqflask/wqflask/templates/base.html | 2 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 5 |
3 files changed, 33 insertions, 7 deletions
diff --git a/wqflask/wqflask/markdown_routes.py b/wqflask/wqflask/markdown_routes.py index 7a9fac41..60d4374c 100644 --- a/wqflask/wqflask/markdown_routes.py +++ b/wqflask/wqflask/markdown_routes.py @@ -9,7 +9,10 @@ from flask import Blueprint from flask import render_template glossary_blueprint = Blueprint('glossary_blueprint', __name__) - +references_blueprint=Blueprint("references_blueprint",__name__) +environments_blueprint=Blueprint("environments_blueprint",__name__) +links_blueprint=Blueprint("links_blueprint",__name__) +policies_blueprint=Blueprint("policies_blueprint",__name__) def render_markdown(file_name): """Try to fetch the file name from Github and if that fails, try to @@ -22,6 +25,7 @@ look for it inside the file system if md_content.status_code == 200: return markdown.Markdown().convert(md_content.content.decode("utf-8")) + # TODO: Add fallback on our git server by checking the mirror. # Content not available @@ -32,8 +36,35 @@ look for it inside the file system "Please reach out to the gn2 team to have a look at this") + + @glossary_blueprint.route('/') def glossary(): return render_template( "glossary.html", rendered_markdown=render_markdown("general/glossary/glossary.md")), 200 + + +@references_blueprint.route('/') +def references(): + return render_template( + "reference.html", + rendered_markdown=render_markdown("general/glossary/glossary.md")), 200 + + + +@environments_blueprint.route("/") +def references(): + return render_template("environments.html",rendered_markdown=render_markdown("general/environments/environments.md")) + + +@links_blueprint.route("/") +def links(): + return rendered_template("links.html",rendered_markdown=render_markdown("general/links/links.md")) + + +policies_blueprint.route("/") +def policies(): + return rendered_template("policies.html",rendered_markdown=rendered_markdown("general/policies/policies.md")) + + diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index 0e572fcf..ca6c9d9b 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -64,7 +64,7 @@ <li class=""> <a href="/help" class="dropdow-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Help <span class="caret"></a> <ul class="dropdown-menu"> - <li><a href="/references">References</a></li> + <li><a href="{{ url_for('references_blueprint.references') }}">References</a></li> <li><a href="/tutorials">Tutorials/Primers</a></li> <li><a href="{{ url_for('glossary_blueprint.glossary') }}">Glossary of Term</a></li> <li><a href="http://gn1.genenetwork.org/faq.html">FAQ</a></li> diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index bf2e9026..060c5a7b 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -301,11 +301,6 @@ def news(): doc = Docs("news", request.args) return render_template("docs.html", **doc.__dict__) -@app.route("/references") -def references(): - doc = Docs("references", request.args) - # return render_template("reference.html") - return render_template("docs.html", **doc.__dict__) @app.route("/intro") def intro(): |