aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--alphabetlearning/resources/views.py5
-rw-r--r--alphabetlearning/templates/resources/resource_detail.html2
2 files changed, 6 insertions, 1 deletions
diff --git a/alphabetlearning/resources/views.py b/alphabetlearning/resources/views.py
index c3d1bcd..773b1c2 100644
--- a/alphabetlearning/resources/views.py
+++ b/alphabetlearning/resources/views.py
@@ -293,6 +293,10 @@ def resource_detail(request, resource_id):
"""
resource_obj = get_object_or_404(Resource, pk=resource_id)
resource_metadata = _extract_metadata_from_resource(resource_obj)
+ try:
+ price = resource_obj.price_obj.first().price / 1000
+ except AttributeError:
+ price = 0
resource = {
"id": resource_obj.id,
"name": resource_obj.name,
@@ -306,6 +310,7 @@ def resource_detail(request, resource_id):
),
"age_range": resource_obj.age_range,
"curriculum": resource_obj.curriculum,
+ "price": price,
"pdf_filenames": resource_metadata.pdf_filenames,
"pdf_urls": resource_metadata.pdf_urls,
"thumbnails": list(
diff --git a/alphabetlearning/templates/resources/resource_detail.html b/alphabetlearning/templates/resources/resource_detail.html
index b92ba52..edbada1 100644
--- a/alphabetlearning/templates/resources/resource_detail.html
+++ b/alphabetlearning/templates/resources/resource_detail.html
@@ -35,7 +35,7 @@
{% endif %}
</div>
<div class="col">
- <p class="fs-3 fw-semibold">£1.50 (or 1 credit)</p>
+ <p class="fs-3 fw-semibold">£{{ resource.price|floatformat:2 }} (or 1 credit)</p>
</div>
<hr>