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)
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:
return redirect("/")

View File

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