diff --git a/source/_patterns/04-components/card/card--node/card--node.twig b/source/_patterns/04-components/card/card--node/card--node.twig index 49ea8e35eb0290463f7276d788265df03fe86aef..d94388e0d2b3bb7c13c81bba56c7b88116db0a20 100644 --- a/source/_patterns/04-components/card/card--node/card--node.twig +++ b/source/_patterns/04-components/card/card--node/card--node.twig @@ -6,17 +6,13 @@ <div class="uw-node__{{ node_image_class }}"> {% include '@components/card/card.twig' with { + 'url': node.url, 'type': type, + 'show_hover': '', + 'header': node.header, 'hero_image': node.hero_image, 'listing_image': node.listing_image, - 'header': node.header, - 'tags': node.tags, 'content': node.content, - 'sources': node.image.sources, - 'show_hover': '', - 'url': node.url, - 'additional_info': node.additional_info, - 'location_info': node.location_info, - 'tags': node.tags, + 'footer': node.footer, } %} </div> diff --git a/source/_patterns/04-components/card/card-elements/_additional-info.twig b/source/_patterns/04-components/card/card-elements/_additional-info.twig index 8d33e636b0e4a93b53ed01df5377a138cda1dffa..145b22e5963c0121bdb8aac0f9692decc0902336 100644 --- a/source/_patterns/04-components/card/card-elements/_additional-info.twig +++ b/source/_patterns/04-components/card/card-elements/_additional-info.twig @@ -27,6 +27,15 @@ {{ additional_info.cost }} {% endif %} + {% if additional_info.tags %} + {% for key,tag in additional_info.tags %} + <span class="uw-label">{{ key }}:</span> + {% include "@components/tag-list/tag-list.twig" with { + items: tag + } %} + {% endfor %} + {% endif %} + {% endblock %} {% endembed %} </div> diff --git a/source/_patterns/04-components/card/card-elements/_location-info.twig b/source/_patterns/04-components/card/card-elements/_location-info.twig index 5c1fcc58cb0ae8a14e32ec73e571cc18c0357dd0..138de6142355e6f1e75f0bb6b1c2bc154acb2fcb 100644 --- a/source/_patterns/04-components/card/card-elements/_location-info.twig +++ b/source/_patterns/04-components/card/card-elements/_location-info.twig @@ -1,3 +1,7 @@ +{% set address = location_info.address %} +{% set map = location_info.map %} +{% set map_link = location_info.map_link %} + <div class="card__location"> {% embed '@components/details/details.twig' with { is_open: TRUE, diff --git a/source/_patterns/04-components/card/card.twig b/source/_patterns/04-components/card/card.twig index 3f233ab4c5e358150a950d5bd0c5418e2b029e5c..406bed8144fc6ef32dde5dc2c18186cde82f1aea 100644 --- a/source/_patterns/04-components/card/card.twig +++ b/source/_patterns/04-components/card/card.twig @@ -40,128 +40,105 @@ </div> - <div class="card__footer"> - {{ footer }} + {% if footer %} + <div class="card__footer"> - {% if additional_info %} - {% include '@components/card/card-elements/_additional-info.twig' with { - 'additional_info': additional_info - } %} - {% endif %} - - {% if contact_info %} - some include - {% endif %} - - {% if link_profile or personal_webpage %} - <div class="card__contact-links"> - {% embed '@components/details/details.twig' %} - {% block details_summary %} - Links - {% endblock %} - - {% block details_content %} - {% if link_profile %} - <div class="card__link-profile"> - <span class="uw-label">Link to Profile:</span> - <a href="{{ link_profile.uri }}">{{ link_profile.title }}</a> + {% if footer.additional_info %} + {% include '@components/card/card-elements/_additional-info.twig' with { + 'additional_info': footer.additional_info + } %} + {% endif %} + + {% if contact_info %} + some include + {% endif %} + + {% if link_profile or personal_webpage %} + <div class="card__contact-links"> + {% embed '@components/details/details.twig' %} + {% block details_summary %} + Links + {% endblock %} + + {% block details_content %} + {% if link_profile %} + <div class="card__link-profile"> + <span class="uw-label">Link to Profile:</span> + <a href="{{ link_profile.uri }}">{{ link_profile.title }}</a> + </div> + {% endif %} + {% if personal_webpage %} + <div class="card__personal-webpage"> + <span class="uw-label">Link to personal webpage:</span> + <a href="{{ personal_webpage.uri }}">{{ personal_webpage.title }}</a> + </div> + {% endif %} + {% endblock %} + {% endembed %} + </div> + {% endif %} + + {% if footer.location_info %} + {% include '@components/card/card-elements/_location-info.twig' with { + 'location_info': footer.location_info + }%} + {% endif %} + + {% if contact_for %} + <div class="card__contact-for"> + {% embed '@components/details/details.twig' %} + {% block details_summary %} + Contact for + {% endblock %} + + {% block details_content %} + <div class="card__contact-for-content"> + {{ contact_for }} </div> - {% endif %} - {% if personal_webpage %} - <div class="card__personal-webpage"> - <span class="uw-label">Link to personal webpage:</span> - <a href="{{ personal_webpage.uri }}">{{ personal_webpage.title }}</a> + {% endblock %} + {% endembed %} + </div> + {% endif %} + + {% if groups %} + <div class="card__groups"> + {% embed '@components/details/details.twig' %} + {% block details_summary %} + Groups + {% endblock %} + + {% block details_content %} + <div class="card__groups-list"> + {% for group in groups %} + {% if loop.index0 > 0 %} + , {{ group.title }} + {% else %} + {{ group.title }} + {% endif %} + {% endfor %} </div> - {% endif %} - {% endblock %} - {% endembed %} - </div> - {% endif %} - - {% if location_info %} - {% include '@components/card/card-elements/_location-info.twig' with { - 'address': location_info.address, - 'map': location_info.map, - 'map_link': location_info.map_link, - }%} - {% endif %} - - {% if contact_for %} - <div class="card__contact-for"> - {% embed '@components/details/details.twig' %} - {% block details_summary %} - Contact for - {% endblock %} - - {% block details_content %} - <div class="card__contact-for-content"> - {{ contact_for }} - </div> - {% endblock %} - {% endembed %} - </div> - {% endif %} - - {% if groups %} - <div class="card__groups"> - {% embed '@components/details/details.twig' %} - {% block details_summary %} - Groups - {% endblock %} - - {% block details_content %} - <div class="card__groups-list"> - {% for group in groups %} - {% if loop.index0 > 0 %} - , {{ group.title }} - {% else %} - {{ group.title }} - {% endif %} - {% endfor %} - </div> - {% endblock %} - {% endembed %} - </div> - {% endif %} - - {% if catalog_tags %} - <div class="card__catalog-tags"> - {% embed '@components/details/details.twig' with { - 'is_open': TRUE, + {% endblock %} + {% endembed %} + </div> + {% endif %} + + {% if footer.tags %} + {% include '@components/card/card-elements/_tags.twig' with { + 'tags': footer.tags, } %} - {% block details_summary %} - Additional Information - {% endblock %} - - {% block details_content %} - {% for key, tag in catalog_tags %} - <div class="card__catalog-tags card__tags-{{ key }}"> - <span class="uw-label">{{ key }}:</span> - {% include "@components/tag-list/tag-list.twig" with { - items: tag - } %} - </div> - {% endfor %} - {% endblock %} - {% endembed %} - {% endif %} - - {% if tags %} - {% include '@components/card/card-elements/_tags.twig' with { - 'tags': tags, - } %} - {% endif %} - - {% if read_more and url %} - <div class="card__readmore"> - {{ macros.readmore(url, title) }} - </div> - {% endif %} - - {% if social_media %} - <div class="card__social {{ social_media_placement }}"> - {% include "@components/menu/menu--social/menu--social.twig" %} - </div> - {% endif %} - </div> + {% endif %} + + {% if read_more and url %} + <div class="card__readmore"> + {{ macros.readmore(url, title) }} + </div> + {% endif %} + + {% if social_media %} + <div class="card__social {{ social_media_placement }}"> + {% include "@components/menu/menu--social/menu--social.twig" %} + </div> + {% endif %} + </div> + {% endif %} </article> diff --git a/source/_patterns/04-components/tag-list/tag-list.twig b/source/_patterns/04-components/tag-list/tag-list.twig index c3874febf9ceed9651bf6d5be45f2a1a951ea743..2a26321e4d87295e995f114440fc4d0930d7e261 100644 --- a/source/_patterns/04-components/tag-list/tag-list.twig +++ b/source/_patterns/04-components/tag-list/tag-list.twig @@ -1,5 +1,4 @@ {% import '@base/macros/uw.macro.twig' as macros %} - <ul class="tag-list {{ modifier_classes }}"> {% for item in items %} <li class="tag-list__item {% if item.faculty %}{{ item.faculty }}{% endif %}">