aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/resources/views.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-07-11 17:20:29 +0100
committerMatthew Lemon <y@yulqen.org>2024-07-11 17:20:29 +0100
commit8547f307748554990ee3cc413776c7dadc830764 (patch)
treebe9d05ae6d9c8f4d792923f68d6719b1b64be166 /pyblackbird_cc/resources/views.py
parent375aec43a2badc5eef86d528745908cb2f572bb7 (diff)
Adds ability to add colour class to main category
- Creates a new line in the database - Uses this in the template instead of the default bootstrap class
Diffstat (limited to '')
-rw-r--r--pyblackbird_cc/resources/views.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/pyblackbird_cc/resources/views.py b/pyblackbird_cc/resources/views.py
index cf6eb9d..bf1f6ba 100644
--- a/pyblackbird_cc/resources/views.py
+++ b/pyblackbird_cc/resources/views.py
@@ -46,6 +46,7 @@ class ResourceInfo:
description: str
card_description: str
main_resource_category_name: str
+ main_resource_category_colour_css_class: str
additional_resource_category_name: str | None
age_range: str | None
pdf_filenames: list[str]
@@ -108,6 +109,7 @@ def _extract_metadata_from_resource(resource_obj) -> ResourceInfo | None:
description=resource_obj.description,
card_description=resource_obj.card_description,
main_resource_category_name=resource_obj.main_resource_category.name,
+ main_resource_category_colour_css_class=resource_obj.main_resource_category.colour_css_class,
additional_resource_category_name=arc_name,
age_range=resource_obj.age_range,
pdf_filenames=pdf_resource_filenames,