feat: add user information to settings

This commit is contained in:
ffqq 2023-07-12 03:54:20 +00:00
parent 7c4c0c7ceb
commit 39bd51a49e
2 changed files with 11 additions and 11 deletions

2
main
View File

@ -654,7 +654,7 @@ def settings():
userCookie = get_session(usersession) userCookie = get_session(usersession)
user = get_user(userCookie["id"]) user = get_user(userCookie["id"])
return render_template("settings.html", userdata=user) return render_template("settings.html", userdata=user, createddate=datetime.datetime.utcfromtimestamp(int(str(user["created"]).split(".")[0])).strftime("%Y-%m-%d %H:%m:%S"))
else: else:
return redirect("/") return redirect("/")

View File

@ -25,16 +25,16 @@
</div> </div>
<div class="postDiv"> <div class="postDiv">
<div class="post"> <div class="post">
{% if userdata.administrator == 1 %} <h3>Account</h3>
Administrator<br><br> <p>Account Type: {% if userdata.administrator == 1 %}Administrator{% else %}Normal{% endif %}<br>
{% endif %} Username: {{ userdata.username }}<br>
Logged in as {{ userdata.username }} User ID: {{ userdata.id }}<br>
<br><br> Created on: {{ createddate }}</p>
<a href="/@{{ userdata.username }}">View my public profile</a><br> <br>
<a href="/settings/logout">Log out</a> <a href="/@{{ userdata.username }}">View my public profile</a><br>
</div> <a href="/settings/logout">Log out</a>
</div>
</div> </div>
</body> </body>
</html> </html>