From d423ab54deb9edf4a306c97ff5ae46fa7033110d Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Sat, 14 May 2016 19:20:47 +0200 Subject: [PATCH] add form to product detail page --- shop/forms.py | 3 +-- shop/templates/product_detail.html | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/shop/forms.py b/shop/forms.py index 1ae7cf09..5d2e98ec 100644 --- a/shop/forms.py +++ b/shop/forms.py @@ -7,6 +7,5 @@ class CheckoutForm(forms.Form): pass class AddToOrderForm(forms.Form): - # no fields, just a submit button - pass + quantity = forms.IntegerField() diff --git a/shop/templates/product_detail.html b/shop/templates/product_detail.html index 6331daeb..7aa53ed3 100644 --- a/shop/templates/product_detail.html +++ b/shop/templates/product_detail.html @@ -1,7 +1,12 @@ {% extends 'base.html' %} +{% load bootstrap3 %} {% block content %} -details for product {{ product.id }} +

{{ product.name }}

+
+ {% csrf_token %} + {% bootstrap_button "Add to order" button_type="submit" button_class="btn-primary" %} +
{% endblock %}