As above,a dded to latest page
This commit is contained in:
parent
90d9b7fcb0
commit
bbda2d968c
1 changed files with 15 additions and 8 deletions
|
@ -51,15 +51,22 @@ def login_page():
|
||||||
def latest():
|
def latest():
|
||||||
quotes = Quote.query.filter_by(approved=True).order_by(Quote.id.desc()).all()
|
quotes = Quote.query.filter_by(approved=True).order_by(Quote.id.desc()).all()
|
||||||
|
|
||||||
# Replace line breaks with html breaks and escape special characters
|
if len(quotes)>0:
|
||||||
for quote in quotes:
|
# Replace line breaks with html breaks and escape special characters
|
||||||
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
for quote in quotes:
|
||||||
|
quote.content = str(Markup.escape(quote.content)).replace('\n', '</br>')
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"latest.html",
|
"latest.html",
|
||||||
title="Latest",
|
title="Latest",
|
||||||
quotes=quotes
|
quotes=quotes
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
return render_template(
|
||||||
|
"message.html",
|
||||||
|
alertclass="alert-warning",
|
||||||
|
message="No quotes in the database. "
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/queue')
|
@app.route('/queue')
|
||||||
|
|
Loading…
Add table
Reference in a new issue