Merge pull request 'feat: add user information to settings' (#7) from ffqq/burgercat-improvedsettings:main into main

Reviewed-on: https://codeberg.org/burger-software/burgercat/pulls/7
This commit is contained in:
maaa 2023-07-12 14:40:18 +00:00
commit d0cacd49ca
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

@ -26,15 +26,15 @@
<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>
<br>
<a href="/@{{ userdata.username }}">View my public profile</a><br> <a href="/@{{ userdata.username }}">View my public profile</a><br>
<a href="/settings/logout">Log out</a> <a href="/settings/logout">Log out</a>
</div> </div>
</div> </div>
</body> </body>
</html> </html>