diff options
Diffstat (limited to 'alphabetlearning/templates/resources/resource_detail.html')
-rw-r--r-- | alphabetlearning/templates/resources/resource_detail.html | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/alphabetlearning/templates/resources/resource_detail.html b/alphabetlearning/templates/resources/resource_detail.html index 6c6ceda..b92ba52 100644 --- a/alphabetlearning/templates/resources/resource_detail.html +++ b/alphabetlearning/templates/resources/resource_detail.html @@ -48,11 +48,20 @@ </div> <div class="row align-items-end"> <div class="my-4 d-flex justify-content-center"> - <form action="{% url 'payments:add_to_cart' resource.id %}" method="get" accept-charset="utf-8"> - <button class="btn btn-primary w-100"> - Add to cart - </button> - </form> + {% if resource.in_cart %} + <form action="{% url 'payments:add_to_basket' resource.id %}" method="get" accept-charset="utf-8"> + <button class="btn btn-primary w-100" disabled> + In basket + </button> + </form> + {% else %} + <form action="{% url 'payments:add_to_basket' resource.id %}" method="get" accept-charset="utf-8"> + <button class="btn btn-primary w-100"> + Add to basket + </button> + </form> + + {% endif %} </div> </div> </div> |