aboutsummaryrefslogtreecommitdiffstats
path: root/alphabetlearning/templates/resources/resource_card_standard.html
diff options
context:
space:
mode:
Diffstat (limited to 'alphabetlearning/templates/resources/resource_card_standard.html')
-rw-r--r--alphabetlearning/templates/resources/resource_card_standard.html18
1 files changed, 14 insertions, 4 deletions
diff --git a/alphabetlearning/templates/resources/resource_card_standard.html b/alphabetlearning/templates/resources/resource_card_standard.html
index 9850117..640f75d 100644
--- a/alphabetlearning/templates/resources/resource_card_standard.html
+++ b/alphabetlearning/templates/resources/resource_card_standard.html
@@ -37,10 +37,20 @@
</div>
<div class="d-flex flex-row justify-content-between align-items-end mt-2">
<p class="card-text m-1"><small class="text-muted">1 credit</small></p>
- <form action="{% url 'payments:add_to_basket' resource.id %}" method="POST">
- {% csrf_token %}
- <button type="submit" class="btn btn-success fs-6 px-2 py-0">Add to basket</button>
- </form>
+
+ {% if resource.in_cart %}
+ <form action="{% url 'payments:add_to_basket' resource.id %}" method="POST">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-success fs-6 px-2 py-0" disabled>In basket</button>
+ </form>
+ {% else %}
+ <form action="{% url 'payments:add_to_basket' resource.id %}" method="POST">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-success fs-6 px-2 py-0">Add to basket</button>
+ </form>
+ {% endif %}
+
+
</div>
</div>
</div>