diff --git a/shop/templates/product_detail.html b/shop/templates/product_detail.html index 07ad2cc8..0d47aa14 100644 --- a/shop/templates/product_detail.html +++ b/shop/templates/product_detail.html @@ -5,9 +5,21 @@

{{ product.name }}

+

+ {{ product.description }} +

+ +{% if user.is_authenticated %}
{% csrf_token %} {% bootstrap_form form %} {% bootstrap_button "Add to order" button_type="submit" button_class="btn-primary" %}
+{% else %} + + Signup or + + login +to order this product +{% endif %} {% endblock %} diff --git a/shop/views.py b/shop/views.py index 394289f6..e7c85b33 100644 --- a/shop/views.py +++ b/shop/views.py @@ -120,7 +120,7 @@ class ShopIndexView(ListView): return context -class ProductDetailView(LoginRequiredMixin, FormView, DetailView): +class ProductDetailView(FormView, DetailView): model = Product template_name = 'product_detail.html' form_class = AddToOrderForm