From 9da2032bb8d9c45b8269629867c88dabb20f6db1 Mon Sep 17 00:00:00 2001 From: namasikanam Date: Mon, 6 Dec 2021 00:14:48 +0800 Subject: [PATCH] user button at homepage --- app.py | 7 ++++++ templates/home.html | 55 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/app.py b/app.py index a265442..dc9669e 100644 --- a/app.py +++ b/app.py @@ -209,6 +209,13 @@ def logout(): @cache.cached(timeout=10) def home(): stories = Story.query.order_by(Story.total_like_num.desc()).all() + + username = session.get('username', '') + avatar = session.get('avatar', C.guest_avatar) + cs_login_url = MAST_LOGIN_URL + guest_login_url = url_for('main_bp.guest_login') + verify_questions = sample_question(C.verify_questions) + return render_template('home.html', **locals()) diff --git a/templates/home.html b/templates/home.html index c542965..e83f069 100644 --- a/templates/home.html +++ b/templates/home.html @@ -24,6 +24,15 @@ +
+
+ +
+
+ {% for story in stories %}
@@ -38,6 +47,41 @@ {% endfor %} + +
@@ -52,4 +96,15 @@ + +