Skip to content

Refactor webshop product labels#2005

Open
0xUnicorn wants to merge 2 commits intobornhack:mainfrom
0xUnicorn:refactor/webshop-product-labels
Open

Refactor webshop product labels#2005
0xUnicorn wants to merge 2 commits intobornhack:mainfrom
0xUnicorn:refactor/webshop-product-labels

Conversation

@0xUnicorn
Copy link
Contributor

Business logic for product labels has been moved from shop_index.html template to a Product model property, with tests.

Template now loads a default label template using a custom template tag for mapping label_type to css class.

I also changed the product labels to bootstrap badges

image

I started this refactoring with the goal of fixing #1985, so do we wanna change the logic for when we show any labels?

Refactor the logic for applying labels to a model property with test.
- Use templatetag for mapping 'label_type' to a css class
@0xUnicorn 0xUnicorn marked this pull request as ready for review February 6, 2026 21:51
@0xUnicorn 0xUnicorn changed the title WIP: Refactor webshop product labels Refactor webshop product labels Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webshop not showing 'sale ends in X days' for all items with end date

1 participant