diff options
author | Matthew Lemon <y@yulqen.org> | 2024-07-28 16:31:21 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-07-28 16:31:21 +0100 |
commit | dcefb7dfc5b171fcc18fb0adf11a49cb39ff2c6b (patch) | |
tree | 30ab7f61b83eec73c2195b2b1c7fa99f9e32adea /pyblackbird_cc/resources/views.py | |
parent | 2c7dc01e289d39dcaac6761ff59870accc7575a8 (diff) |
Added border and badge colour based on category
- You have to define them on the ResourceCategory model in the database
Diffstat (limited to 'pyblackbird_cc/resources/views.py')
-rw-r--r-- | pyblackbird_cc/resources/views.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pyblackbird_cc/resources/views.py b/pyblackbird_cc/resources/views.py index bf1f6ba..db236f0 100644 --- a/pyblackbird_cc/resources/views.py +++ b/pyblackbird_cc/resources/views.py @@ -47,6 +47,7 @@ class ResourceInfo: card_description: str main_resource_category_name: str main_resource_category_colour_css_class: str + main_resource_badge_foreground_colour: str additional_resource_category_name: str | None age_range: str | None pdf_filenames: list[str] @@ -110,6 +111,7 @@ def _extract_metadata_from_resource(resource_obj) -> ResourceInfo | None: 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, + main_resource_badge_foreground_colour=resource_obj.main_resource_category.badge_foreground_colour, additional_resource_category_name=arc_name, age_range=resource_obj.age_range, pdf_filenames=pdf_resource_filenames, |