From d66290d9353e26d4147fd7c04f35116d1fda003e Mon Sep 17 00:00:00 2001 From: csd4ni3l Date: Fri, 15 Aug 2025 16:57:33 +0200 Subject: [PATCH] fix achievements not shown in in profile and also make profile dark mode --- main.py | 4 ++-- templates/profile.jinja2 | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/main.py b/main.py index 3d55210..bcd8355 100644 --- a/main.py +++ b/main.py @@ -272,7 +272,7 @@ def profile(): grass_touching_count, last_grass_touch_time = row - return render_template("profile.jinja2", username=username, grass_touching_count=grass_touching_count, last_grass_touch_time=float(last_grass_touch_time), now=time.time(), your_account=True) + return render_template("profile.jinja2", username=username, grass_touching_count=grass_touching_count, last_grass_touch_time=float(last_grass_touch_time), now=time.time(), achievements=ACHIEVEMENTS, your_account=True) @app.route("/profile/") def public_profile(username): @@ -289,7 +289,7 @@ def public_profile(username): grass_touching_count, last_grass_touch_time = row - return render_template("profile.jinja2", username=username, grass_touching_count=grass_touching_count, last_grass_touch_time=float(last_grass_touch_time), now=time.time(), your_account=False) + return render_template("profile.jinja2", username=username, grass_touching_count=grass_touching_count, last_grass_touch_time=float(last_grass_touch_time), now=time.time(), achievements=ACHIEVEMENTS, your_account=False) @app.route("/login", methods=["GET", "POST"]) def login(): diff --git a/templates/profile.jinja2 b/templates/profile.jinja2 index 77cbf4f..f223044 100644 --- a/templates/profile.jinja2 +++ b/templates/profile.jinja2 @@ -2,6 +2,7 @@ {% block title %}Grass Touching Profile{% endblock %} {% block body %} +
-
+

Profile Overview{% if not your_account%} of {{ username}} {% endif %}

@@ -39,7 +40,7 @@
-
+

Achievements{% if not your_account%} of {{ username}} {% endif %}

@@ -47,7 +48,7 @@ {% for achievement in achievements %} {% set unlocked = grass_touching_count >= achievement[0] %}
-
+
{% if unlocked %} @@ -69,41 +70,41 @@
{% if your_account %} -
+

Change Username

- +
-
+

Change Password

- +
- +
- +
-
+

Danger Zone

These actions cannot be undone!

@@ -121,4 +122,5 @@
{% endif %}
+ {% endblock %}