From 9c9b3084939e77618854e2cbe3cce51029a70f07 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 5 Aug 2024 21:20:21 +0100 Subject: wip: adding delete and replace buttons for PDFs --- .../templates/resources/resource_detail.html | 175 +++++++++++---------- 1 file changed, 92 insertions(+), 83 deletions(-) (limited to 'pyblackbird_cc/templates/resources/resource_detail.html') diff --git a/pyblackbird_cc/templates/resources/resource_detail.html b/pyblackbird_cc/templates/resources/resource_detail.html index 67694fa..a68c321 100644 --- a/pyblackbird_cc/templates/resources/resource_detail.html +++ b/pyblackbird_cc/templates/resources/resource_detail.html @@ -3,110 +3,119 @@ {% load markdown_extras %} {% block content %} -
+
-
-

{{ resource.name }}

-
-
- Subject: {{ resource.main_resource_category }} -
-
- Age range: {{ resource.age_range }} -
-
- Resource type: {{ resource.resource_type }} -
-
- Number of files in this resource: {{ resource.pdf_filenames|length }} -
-
-
-
- Created: {{ resource.created|date:"D d M Y" }} -
-
- {% if request.user.is_authenticated and request.user.is_staff %} - Edit this resource - {% endif %} -
+
+

{{ resource.name }}

+
+
+ Subject: {{ resource.main_resource_category }} +
+
+ Age range: {{ resource.age_range }} +
+
+ Resource type: {{ resource.resource_type }} +
+
+ Number of files in this resource: {{ resource.pdf_filenames|length }} +
+
+
+
+ Created: {{ resource.created|date:"D d M Y" }} +
+
+ {% if request.user.is_authenticated and request.user.is_staff %} + Edit this resource + {% endif %} +
+
-
-
-

Feature images

-
- {% for tn_url, tn_filename in resource.thumbnails %} -
- {{ tn_filename }} +
+

Feature images

+
+ {% for tn_url, tn_filename in resource.thumbnails %} +
+ {{ tn_filename }} +
+ {% endfor %}
- {% endfor %}
-
- + {% for snapshot_filename, snapshot_urls in resource.snapshot_urls.items %} -
+
- {% if resource.snapshot_urls.items|length > 1 %} -

File preview {{ forloop.counter }}: {{ snapshot_filename|cut:".pdf" }}

- {% else %} -

File preview: {{ snapshot_filename|cut:".pdf" }}

- {% endif %} + {% if resource.snapshot_urls.items|length > 1 %} +

File preview {{ forloop.counter }}: {{ snapshot_filename|cut:".pdf" }}

+ {% else %} +

File preview: {{ snapshot_filename|cut:".pdf" }}

+ {% endif %} -