From 2d23f9521fbcf619240fa70a34d7dc0c7ca7e851 Mon Sep 17 00:00:00 2001 From: KF7EEL Date: Mon, 2 Aug 2021 12:29:12 -0700 Subject: [PATCH] add news to index.html --- web/app.py | 17 ++++++++++++++++- web/templates/index.html | 15 +++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/web/app.py b/web/app.py index e102d46..1ae1329 100644 --- a/web/app.py +++ b/web/app.py @@ -599,7 +599,22 @@ def create_app(): @app.route('/') def home_page(): #content = Markup('Index') - return render_template('index.html') #, markup_content = content) + l_news = News.query.order_by(News.time.desc()).first() + content = ''' + + + + + + + + + + +
+

''' + l_news.subject + '''

+
''' + l_news.date + '''

''' + l_news.text + '''

''' + return render_template('index.html', news = Markup(content)) @app.route('/help') def help_page(): diff --git a/web/templates/index.html b/web/templates/index.html index 8cb812a..ae53d75 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -1,4 +1,19 @@ {% extends 'flask_user/_public_base.html' %} {% block content %} +

 

+

Welcome to the {{ user_manager.USER_APP_NAME }}. This tool is used to manage your access.

+ +

 

+ + + + + + +
+

Latest News:

+{{news}} +
+

 

{% endblock %}