|
| 1 | +{% extends "v3/includes/_card_group.html" %} |
| 2 | +{% comment %} |
| 3 | + Community Card — extends _card_group.html to render community connection items. |
| 4 | + |
| 5 | + Variables (passed to _card_group.html): |
| 6 | + heading (string, optional) — section heading text |
| 7 | + heading_url (string, optional) — if set, heading becomes a link |
| 8 | + items (list, optional) — list of event objects with: |
| 9 | + - title (string, required) — event title |
| 10 | + - description (string, optional) — event description |
| 11 | + - date (string, required) — human-readable date (e.g. "29/10/25") |
| 12 | + - datetime (string, optional) — value for <time datetime="..."> |
| 13 | + - card_url (string, optional) — if set, the card is wrapped in a link |
| 14 | + - card_aria_label (string, optional) — aria-label for the link; defaults to title |
| 15 | + variant (string, optional) — "list" or "card", defaults to "list" |
| 16 | + theme (string, optional) — only for variant "card": "default", "grey", "yellow", "green", "teal" |
| 17 | + layout (string, optional) — "vertical" or "horizontal", defaults to "vertical" |
| 18 | + primary_cta_label (string, optional) — primary CTA button label |
| 19 | + primary_cta_url (string, optional) — primary CTA button URL |
| 20 | + secondary_cta_label (string, optional) — secondary CTA button label |
| 21 | + secondary_cta_url (string, optional) — secondary CTA button URL |
| 22 | + |
| 23 | + Usage: |
| 24 | + {% include "v3/includes/_event_card.html" with heading="Upcoming Events" items=events variant="card" theme="teal" primary_cta_label="View events" primary_cta_url="/events/" %} |
| 25 | +{% endcomment %} |
| 26 | +{% block card_list %} |
| 27 | +{% if items %} |
| 28 | + <ul class="card-group__list"> |
| 29 | + {% for item in items %} |
| 30 | + <li class="card-group__item"> |
| 31 | + <article class="community-card"> |
| 32 | + <h3 class="community-card__title">{{ item.title }}</h3> |
| 33 | + {% if item.description %} |
| 34 | + <p class="community-card__description">{{ item.description }}</p> |
| 35 | + {% endif %} |
| 36 | + {% if item.cta_url and item.cta_label %} |
| 37 | + <a href="{{ item.cta_url }}" |
| 38 | + class="community-card__link" |
| 39 | + aria-label="{{ item.card_aria_label|default:item.cta_label }}"> |
| 40 | + {{item.cta_label}} |
| 41 | + </a> |
| 42 | + {% endif %} |
| 43 | + </article> |
| 44 | + </li> |
| 45 | + {% endfor %} |
| 46 | + </ul> |
| 47 | +{% endif %} |
| 48 | +{% endblock %} |
0 commit comments