add news to index.html
This commit is contained in:
parent
2f2053a236
commit
2d23f9521f
17
web/app.py
17
web/app.py
@ -599,7 +599,22 @@ def create_app():
|
|||||||
@app.route('/')
|
@app.route('/')
|
||||||
def home_page():
|
def home_page():
|
||||||
#content = Markup('<strong>Index</strong>')
|
#content = Markup('<strong>Index</strong>')
|
||||||
return render_template('index.html') #, markup_content = content)
|
l_news = News.query.order_by(News.time.desc()).first()
|
||||||
|
content = '''
|
||||||
|
<table style="width: 600px; margin-left: auto; margin-right: auto;" border="1" cellpadding="5">
|
||||||
|
<tr>
|
||||||
|
<td style="text-align: center;">
|
||||||
|
<h3>''' + l_news.subject + '''</h3>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align: center;"><strong>''' + l_news.date + '''</strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><br />''' + l_news.text + '''<br /><br /></td>
|
||||||
|
</tr>
|
||||||
|
</tbody></table>'''
|
||||||
|
return render_template('index.html', news = Markup(content))
|
||||||
|
|
||||||
@app.route('/help')
|
@app.route('/help')
|
||||||
def help_page():
|
def help_page():
|
||||||
|
@ -1,4 +1,19 @@
|
|||||||
{% extends 'flask_user/_public_base.html' %}
|
{% extends 'flask_user/_public_base.html' %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<p> </p>
|
||||||
|
|
||||||
<p>Welcome to the <strong>{{ user_manager.USER_APP_NAME }}</strong>. This tool is used to manage your access.</p>
|
<p>Welcome to the <strong>{{ user_manager.USER_APP_NAME }}</strong>. This tool is used to manage your access.</p>
|
||||||
|
|
||||||
|
<p> </p>
|
||||||
|
<table style="width: 600px; margin-left: auto; margin-right: auto;" border="1">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align: center;">
|
||||||
|
<h4>Latest News:</h4>
|
||||||
|
{{news}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p> </p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user