From d8610fb1e381bddb97a36e66569d3613c57d44fd Mon Sep 17 00:00:00 2001 From: Ekaterina Vititneva Date: Fri, 9 Aug 2024 22:22:22 +0200 Subject: [PATCH] Adding to watchlist --- .../templates/auctions/categories.html | 28 ++++++++++++ .../auctions/templates/auctions/layout.html | 4 +- .../auctions/templates/auctions/listing.html | 9 +++- .../templates/auctions/watchlist.html | 28 ++++++++++++ project_2/commerce/auctions/urls.py | 2 + project_2/commerce/auctions/views.py | 43 ++++++++++++++++++- 6 files changed, 108 insertions(+), 6 deletions(-) create mode 100644 project_2/commerce/auctions/templates/auctions/categories.html create mode 100644 project_2/commerce/auctions/templates/auctions/watchlist.html diff --git a/project_2/commerce/auctions/templates/auctions/categories.html b/project_2/commerce/auctions/templates/auctions/categories.html new file mode 100644 index 0000000..8d29efd --- /dev/null +++ b/project_2/commerce/auctions/templates/auctions/categories.html @@ -0,0 +1,28 @@ +{% extends "auctions/layout.html" %} + +{% block body %} +

Active Listings

+ + +
+ {% for listing in listings %} + +
+ {% if listing.imageURL %} + listing image + {% else %} +
+ {% endif %} +
+
{{ listing.title }}
+
Price: {{ listing.bid }}€
+

{{ listing.description }}

+
+ +
+
+ {% endfor %} +
+{% endblock %} \ No newline at end of file diff --git a/project_2/commerce/auctions/templates/auctions/layout.html b/project_2/commerce/auctions/templates/auctions/layout.html index 98f3e51..2aa6c21 100644 --- a/project_2/commerce/auctions/templates/auctions/layout.html +++ b/project_2/commerce/auctions/templates/auctions/layout.html @@ -21,14 +21,14 @@

Auctions

Active Listings {% if user.is_authenticated %}