diff --git a/FIRST_SETUP_GUIDE.md b/FIRST_SETUP_GUIDE.md index 05767cf..d9cc22d 100644 --- a/FIRST_SETUP_GUIDE.md +++ b/FIRST_SETUP_GUIDE.md @@ -53,7 +53,7 @@ Brand(id=6, title="Orange", image="media/model_img/brands/Orange.png").save() Brand(id=7, title="Ros", image="media/model_img/brands/Ros.png").save() Brand(id=8, title="Suityou", image="media/model_img/brands/Suityou.png").save() Brand(id=9, title="Uniqueme", image="media/model_img/brands/Uniqueme.png").save() -Brand(id=10, title="Zeus", image="media/model_img/brands/Zues.png").save() +Brand(id=10, title="Zeus", image="media/model_img/brands/Zeus.png").save() Cloth(id=1, title="DDICE Hoodie unisex (S) (Black)", brand=Brand.objects.get(title="Ddice"), image="media/model_img/cloths/ddice hoodie black uni.png", color="Black", is_in_stock=True, in_stocks=120, is_on_sale=False, og_price=550, price=550, stars=3.9, is_recommend=True, gender="Unisex", cloth_type="Hoody", size="S").save() Cloth(id=2, title="DDICE Hoodie unisex (M) (Black)", brand=Brand.objects.get(title="Ddice"), image="media/model_img/cloths/ddice hoodie black uni.png", color="Black", is_in_stock=True, in_stocks=110, is_on_sale=False, og_price=550, price=550, stars=3.9, is_recommend=True, gender="Unisex", cloth_type="Hoody", size="M").save() diff --git a/code/main/views.py b/code/main/views.py index 5d1da74..eb325a6 100644 --- a/code/main/views.py +++ b/code/main/views.py @@ -34,7 +34,7 @@ def home(request): if 'cloth_data' not in request.session: request.session['cloth_data'] = GetAllClothData() - return render(request, "homepage.html") + return render(request, "homepage.html", {'brand_data': Brand.objects.all()}) def product_computer(request, id): product = Computer.objects.get(id=id) diff --git a/code/templates/homepage.html b/code/templates/homepage.html index 9775b65..311413e 100644 --- a/code/templates/homepage.html +++ b/code/templates/homepage.html @@ -7,8 +7,37 @@ AOS.init();
-

Homepage

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Homepage

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+
+
+

Search Products from Brands

+
+ {% for brand in brand_data %} +
+
+ {% if brand.title == 'Orange' %} + + {% else %} + + {% endif %} +
+ {{ brand.title }} +
+
+
+
+ {% empty %} +
+
+

Looks like database didn't exist..

+

Did you follow the setup guide?

+
+
+ {% endfor %} +
+
+
{% endblock %} \ No newline at end of file