aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2021-06-15 20:49:39 +0000
committerzsloan2021-06-15 20:49:39 +0000
commit04a869d708bafe805441d70ff3c588e1e244d439 (patch)
tree467c744d58435a679686ce1c7e046a527f019bcd /wqflask
parent1baf5f7611909c651483208184c5fbf7d4a7a088 (diff)
downloadgenenetwork2-04a869d708bafe805441d70ff3c588e1e244d439.tar.gz
Use markdown from Github for News
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/__init__.py3
-rw-r--r--wqflask/wqflask/markdown_routes.py8
-rw-r--r--wqflask/wqflask/templates/news.html33
-rw-r--r--wqflask/wqflask/views.py6
4 files changed, 28 insertions, 22 deletions
diff --git a/wqflask/wqflask/__init__.py b/wqflask/wqflask/__init__.py
index 2e94dd01..8b2055cd 100644
--- a/wqflask/wqflask/__init__.py
+++ b/wqflask/wqflask/__init__.py
@@ -15,6 +15,7 @@ from wqflask.markdown_routes import policies_blueprint
from wqflask.markdown_routes import environments_blueprint
from wqflask.markdown_routes import facilities_blueprint
from wqflask.markdown_routes import blogs_blueprint
+from wqflask.markdown_routes import news_blueprint
app = Flask(__name__)
@@ -52,6 +53,7 @@ app.register_blueprint(policies_blueprint, url_prefix="/policies")
app.register_blueprint(environments_blueprint, url_prefix="/environments")
app.register_blueprint(facilities_blueprint, url_prefix="/facilities")
app.register_blueprint(blogs_blueprint, url_prefix="/blogs")
+app.register_blueprint(news_blueprint, url_prefix="/news")
@app.before_request
@@ -68,7 +70,6 @@ from wqflask import export_traits
from wqflask import gsearch
from wqflask import update_search_results
from wqflask import docs
-from wqflask import news
from wqflask import db_info
from wqflask import user_login
from wqflask import user_session
diff --git a/wqflask/wqflask/markdown_routes.py b/wqflask/wqflask/markdown_routes.py
index b81bfb55..580b9ac0 100644
--- a/wqflask/wqflask/markdown_routes.py
+++ b/wqflask/wqflask/markdown_routes.py
@@ -23,6 +23,7 @@ environments_blueprint = Blueprint("environments_blueprint", __name__)
links_blueprint = Blueprint("links_blueprint", __name__)
policies_blueprint = Blueprint("policies_blueprint", __name__)
facilities_blueprint = Blueprint("facilities_blueprint", __name__)
+news_blueprint = Blueprint("news_blueprint", __name__)
blogs_blueprint = Blueprint("blogs_blueprint", __name__)
@@ -109,6 +110,13 @@ def references():
rendered_markdown=render_markdown("general/references/references.md")), 200
+@news_blueprint.route('/')
+def news():
+ return render_template(
+ "news.html",
+ rendered_markdown=render_markdown("general/news/news.md")), 200
+
+
@environments_blueprint.route("/")
def environments():
diff --git a/wqflask/wqflask/templates/news.html b/wqflask/wqflask/templates/news.html
index 1ec302e6..a615564b 100644
--- a/wqflask/wqflask/templates/news.html
+++ b/wqflask/wqflask/templates/news.html
@@ -1,21 +1,24 @@
{% extends "base.html" %}
-{% block title %}{{title}}{% endblock %}
+{% block title %}News{% endblock %}
+
+{% block css %}
+<link rel="stylesheet" type="text/css" href="/static/new/css/markdown.css" />
+{% endblock %}
{% block content %}
-<div class="container">
- <h3>{{title}}</h3>
- <table class="table" style="width: 600px;">
- <tbody>
- {% for newsitem in newslist %}
- <tr>
- <td style="width: 90px; text-wrap:none;" nowrap>
- <span style="font-weight: bold;">{{newsitem.date}}</span>
- </td>
- <td>{{newsitem.details|safe}}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
+
+ <div class="github-btn-container">
+ <div class="github-btn">
+ <a href="https://github.com/genenetwork/gn-docs/blob/master/general/news/news.md">
+ Edit Text
+ <img src="/static/images/edit.png">
+ </a>
+ </div>
</div>
+<div id="markdown" class="container">
+ {{ rendered_markdown|safe }}
+
+</div>
+
{% endblock %}
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index f96e5034..b9181368 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -394,12 +394,6 @@ def ctl_setup():
# return render_template("ctl_results.html", **result)
-@app.route("/news")
-def news():
- doc = Docs("news", request.args)
- return render_template("docs.html", **doc.__dict__)
-
-
@app.route("/intro")
def intro():
doc = Docs("intro", request.args)