From a034bdd4f2a1fd665c606d2a75485abbfa627789 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 1 Aug 2024 19:10:30 +0100 Subject: Responsive feature cards on index page - Width is responsive - Breakpoints allow for stacking at smaller ones --- .../templates/resources/resource_list.html | 157 +++++++++++---------- 1 file changed, 82 insertions(+), 75 deletions(-) (limited to 'pyblackbird_cc/templates/resources') diff --git a/pyblackbird_cc/templates/resources/resource_list.html b/pyblackbird_cc/templates/resources/resource_list.html index 34c272f..2f137e0 100644 --- a/pyblackbird_cc/templates/resources/resource_list.html +++ b/pyblackbird_cc/templates/resources/resource_list.html @@ -39,18 +39,84 @@ {# featured resources#}
-
- {% if featured_resources %} -
-
-
Featured resources
+
+ {% if featured_resources %} +
+
+
Featured resources
+
+
+
+ {% for resource in featured_resources %} + {% if featured_resources|length == 1 %} +
+ {% elif featured_resources|length == 2 %} +
+ {% else %} +
+ {% endif %} +
+ {{ resource.thumbnail_filename }} +
+
{{ resource.name }}
+
+
+ {% if resource.main_resource_category_name == "English as a Foreign Language (EFL)" %} + EFL + {% else %} + {{ resource.main_resource_category_name }} + {% endif %}
+
+ {{ resource.age_range }} +
+ {% if request.user.is_authenticated and request.user.is_staff %} +
+ Feature slot: {{ resource.feature_slot }} +
+ {% endif %} +
+ {% if resource.card_description %} +

{{ resource.card_description | markdown | safe }}

+ {% else %} +

{{ resource.description | markdown | safe }}

+ {% endif %} +
+ {% if request.user.is_authenticated and request.user.is_staff %} + +
+
+ {% endfor %} + {% else %} +

There are no featured resources

+ {% endif %} +
+
+ +{# standard resources #} +
+
+ {% if resource_list %} +
+
+
Standard resources
-
- {% for resource in featured_resources %} - -
+
+
+ {% for resource in resource_list %} + {#
#} +
{{ resource.thumbnail_filename }} @@ -70,11 +136,6 @@
{{ resource.age_range }}
- {% if request.user.is_authenticated and request.user.is_staff %} -
- Feature slot: {{ resource.feature_slot }} -
- {% endif %}
{% if resource.card_description %}

{{ resource.card_description | markdown | safe }}

@@ -90,65 +151,11 @@
{% endfor %} - {% else %} -

There are no featured resources

- {% endif %}
-
- - {# standard resources #} -
-
- {% if resource_list %} -
-
-
Standard resources
-
-
-
- {% for resource in resource_list %} - {#
#} -
- {{ resource.thumbnail_filename }} -
-
{{ resource.name }}
-
-
- {% if resource.main_resource_category_name == "English as a Foreign Language (EFL)" %} - EFL - {% else %} - {{ resource.main_resource_category_name }} - {% endif %} -
-
- {{ resource.age_range }} -
-
- {% if resource.card_description %} -

{{ resource.card_description | markdown | safe }}

- {% else %} -

{{ resource.description | markdown | safe }}

- {% endif %} -
- {% if request.user.is_authenticated and request.user.is_staff %} - -
- {% endfor %} -
-
- {% else %} -

There are no resources

- {% endif %} -
-
+
+ {% else %} +

There are no resources

+ {% endif %} +
+
{% endblock content %} -- cgit v1.2.3