From fdad58a45d673ae950e45b44ac4b2bbcc1021154 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 5 Sep 2023 18:33:41 +0200 Subject: [PATCH] appstore: implement voting on wishlist --- store/templates/wishlist.html | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/store/templates/wishlist.html b/store/templates/wishlist.html index c86f5a45..e967ae67 100644 --- a/store/templates/wishlist.html +++ b/store/templates/wishlist.html @@ -81,13 +81,27 @@ {% endif %} + {% set this_app_stars = stars.get(app, {})|length %} + {% if user %} + {% set user_starred_this_app = user['id'] in stars.get(app, {}) %} + {% else %} + {% set user_starred_this_app = False %} + {% endif %} - {{ stars.get(app, {})|length }} - - + {% if not user_starred_this_app %} + {{ this_app_stars }} + + + + {% else %} + {{ this_app_stars }} + + + + {% endif %}