From 6fd074b8d295a7ff6eab7a3358096f5baed9d9c9 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 7 Oct 2024 19:54:52 +0100 Subject: wip: redesigning the detail page --- pyblackbird_cc/resources/views.py | 1 + .../templates/resources/resource_detail.html | 246 +++++++++++++-------- 2 files changed, 151 insertions(+), 96 deletions(-) (limited to 'pyblackbird_cc') diff --git a/pyblackbird_cc/resources/views.py b/pyblackbird_cc/resources/views.py index ca7ce73..1b3312e 100644 --- a/pyblackbird_cc/resources/views.py +++ b/pyblackbird_cc/resources/views.py @@ -289,6 +289,7 @@ def resource_detail(request, resource_id): "id": resource_obj.id, "name": resource_obj.name, "description": resource_obj.description, + "card_description": resource_obj.card_description, "resource_type": resource_obj.resource_type.name, "main_resource_category": resource_obj.main_resource_category.name, "additional_resource_category": ( diff --git a/pyblackbird_cc/templates/resources/resource_detail.html b/pyblackbird_cc/templates/resources/resource_detail.html index 64747a2..33096a0 100644 --- a/pyblackbird_cc/templates/resources/resource_detail.html +++ b/pyblackbird_cc/templates/resources/resource_detail.html @@ -3,18 +3,93 @@ {% load markdown_extras %} {% block content %} -
+
+
+

This should be left.

+
+
+

This should be right.

+
+
-
-
-
-
-

{{ resource.name }}

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

{{ resource.name }}

+
+
+
+
+

{{ resource.main_resource_category }}

+
+
+
+
+

{{ resource.age_range }}

+
+
+
+
+

Number of PDF files: {{ resource.pdf_filenames|length }}

+
+
+
+
+

Product summary

+ +

{{resource.card_description}}

+
+
+
+
+ +
+ +
+
+
+ + + +
+ {% for snapshot_filename, snapshot_urls in resource.snapshot_urls.items %} + {% for snapshot_url in snapshot_urls %} +
+ {{ snapshot_name }} +
+ {% endfor %} + {% endfor %} +
+ + +
+
+

Product detail

+ {{ resource.description | markdown | safe }} +
+
+ +
+
+
+
+

{{ resource.name }}

+
+
+
+ @@ -35,114 +110,93 @@ - -
Subject {{ resource.main_resource_category }}Created {{ resource.created|date:"D d M Y" }}
-
-
Resource Description
-
{{ resource.description | markdown | safe }}
-
+ + +
+
Resource Description
+
{{ resource.description | markdown | safe }}
+
-
- {% if request.user.is_authenticated and request.user.is_staff %} - Edit this resource - {% endif %} -
+
+ {% 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 }} -
- {% endfor %} +
+
+
+
+

Feature Images

+
+
+
+ {% for tn_url, tn_filename in resource.thumbnails %} +
+ {{ tn_filename }}
+ {% 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 %} -
-
-