-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 [#1168] Set if/else statement for theme cards with/without products…
…/subthemes
- Loading branch information
1 parent
d9ec17c
commit f8a1647
Showing
2 changed files
with
22 additions
and
9 deletions.
There are no files selected for viewing
29 changes: 21 additions & 8 deletions
29
src/open_inwoner/components/templates/components/Card/CategoryCard.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,33 @@ | ||
{% load card_tags icon_tags link_tags helpers utils %} | ||
|
||
{# create tag for anchor around card - never use anchors within anchors for valid HTML. #} | ||
<div title="{{ category }}" aria-describedby="Thema's" class="card"> | ||
{% if category.products.published %} | ||
<div title="{{ category }}" aria-label="{{ category.name }}" class="card"> | ||
<div class="card__body"> | ||
{% if category %} | ||
<p class="h3"> | ||
<a href="{{ category.slug }}" class="link link__text">{{ category }}</a> | ||
</p> | ||
{% endif %} | ||
{% for product in category.products.published %} | ||
{% with category as parent %} | ||
<div class="card__categories"> | ||
{% get_product_url product as product_url %} | ||
{% link href=product_url icon='arrow_forward' icon_position='before' secondary=True text=product.name %} | ||
</div> | ||
{% endwith %} | ||
{% endfor %} | ||
{% with category as parent %} | ||
<div class="card__categories"> | ||
{% get_product_url product as product_url %} | ||
{% link href=product_url icon='arrow_forward' icon_position='before' secondary=True text=product.name %} | ||
</div> | ||
{% endwith %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
|
||
{% else %} | ||
<a href="{{ category.slug }}" title="{{ category }}" class="card"> | ||
<div class="card__body"> | ||
{% if category %} | ||
<p class="h3"> | ||
<span class="link link__text">{{ category }}</span> | ||
</p> | ||
{% endif %} | ||
</div> | ||
</a> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters