Added infinite scroll
This commit is contained in:
@@ -16,12 +16,17 @@ def feed(page):
|
||||
|
||||
posts = database.fetch("SELECT * FROM entry ORDER BY created_at DESC LIMIT ? OFFSET ?", [count, offset])
|
||||
|
||||
if len(posts) <= 0:
|
||||
return """<div id="infinite-scroll-indicator">
|
||||
<h2>YOU REACHED THE END!</h2>
|
||||
</div>"""
|
||||
|
||||
posts_with_usernames = []
|
||||
for post in posts:
|
||||
username = database.fetch("SELECT username FROM user WHERE uid = ?", [post[2]])
|
||||
posts_with_usernames.append(post + username[0])
|
||||
|
||||
return render_template("entry/feed.html", posts=posts_with_usernames)
|
||||
return render_template("entry/feed.html", posts=posts_with_usernames, page=page)
|
||||
|
||||
@app.route("/entry/create", methods=['GET', 'POST'])
|
||||
def newentry():
|
||||
|
||||
Reference in New Issue
Block a user