diff options
author | Matthew Lemon <y@yulqen.org> | 2024-07-29 14:36:00 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-07-29 14:36:00 +0100 |
commit | bea8fa333266552b44f09b35994a41657b666d11 (patch) | |
tree | 505536d48c8ef784a3923da89dc6cf38f310c3e1 | |
parent | 35a2334c5c6fab308cdfc2c992d75a8d917eda91 (diff) |
Handle the long EFL badge name
The full title of "English as a Foreign Language (EFL)" did not fit inside a badge, so we have had to add a conditional in the template to guard against it.
-rw-r--r-- | pyblackbird_cc/templates/resources/resource_list.html | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pyblackbird_cc/templates/resources/resource_list.html b/pyblackbird_cc/templates/resources/resource_list.html index 4609519..ac27d69 100644 --- a/pyblackbird_cc/templates/resources/resource_list.html +++ b/pyblackbird_cc/templates/resources/resource_list.html @@ -56,8 +56,13 @@ href="{% url 'resources:resource_detail' resource_id=resource.id %}">{{ resource.name }}</a></h5> <div class="d-flex flex-row justify-content-start align-content-center"> <div> - <span class="badge me-2" - style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">{{ resource.main_resource_category_name }}</span> + {% if resource.main_resource_category_name == "English as a Foreign Language (EFL)" %} + <span class="badge me-2" + style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">EFL</span> + {% else %} + <span class="badge me-2" + style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">{{ resource.main_resource_category_name }}</span> + {% endif %} </div> <div> <span class="badge bg-secondary me-2">{{ resource.age_range }}</span> |