From cd687381ea6df98a31177e81bda670b614bb6987 Mon Sep 17 00:00:00 2001 From: marcsello Date: Sat, 28 Nov 2020 23:25:48 +0100 Subject: [PATCH] Added purchases to profile --- src/templates/profile.html | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/templates/profile.html b/src/templates/profile.html index e9eb808..852b429 100644 --- a/src/templates/profile.html +++ b/src/templates/profile.html @@ -8,6 +8,7 @@
{% if current_user.uploads %} +

Your uploads

{% for item in current_user.uploads %}
@@ -21,16 +22,35 @@ {{ item.name }}

Download + class="btn btn-primary" target="_self">Download
{% endfor %} - - {% else %} -

No images available.

{% endif %} +
+

Your purchases

+
+ {% for purchase in current_user.purchases %} +
+
+
+ {{ purchase.item.name }} +

+ {{ purchase.item.name }} by {{ purchase.item.uploader.name }} +

+ Download +
+
+
+ {% endfor %} +
+
{% else %}

Log in to view your profile.

{% endif %}