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 145b22e5963c0121bdb8aac0f9692decc0902336..364c8ba1b37d0463e4bd47b67d8812cb42e7066b 100644 --- a/source/_patterns/04-components/card/card-elements/_additional-info.twig +++ b/source/_patterns/04-components/card/card-elements/_additional-info.twig @@ -36,6 +36,10 @@ {% endfor %} {% endif %} + {% if additional_info.info %} + {{ additional_info.info }} + {% endif %} + {% endblock %} {% endembed %} </div> diff --git a/source/_patterns/04-components/card/card-elements/_contact-for.twig b/source/_patterns/04-components/card/card-elements/_contact-for.twig new file mode 100644 index 0000000000000000000000000000000000000000..9da22069c69ab381e9fb914b1dbed5d1943136e2 --- /dev/null +++ b/source/_patterns/04-components/card/card-elements/_contact-for.twig @@ -0,0 +1,13 @@ +<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.contact }} + </div> + {% endblock %} + {% endembed %} +</div> diff --git a/source/_patterns/04-components/card/card-elements/_contact-info.twig b/source/_patterns/04-components/card/card-elements/_contact-info.twig new file mode 100644 index 0000000000000000000000000000000000000000..1257832ddc18021f4489ab6ec012bec7756f99d8 --- /dev/null +++ b/source/_patterns/04-components/card/card-elements/_contact-info.twig @@ -0,0 +1,26 @@ +<div class="card__contact-info"> + {% embed '@components/details/details.twig' %} + {% block details_summary %} + Contact Information + {% endblock %} + + {% block details_content %} + {% if contact_info.email %} + <div class="card__contact-info--email"> + <a href="mailto:{{ contact_info.email }}">{{ contact_info.email }}</a> + </div> + {% endif %} + {% if contact_info.phone %} + <div class="card__contact-info--phone"> + {{ contact_info.phone }} + </div> + {% endif %} + {% if contact_info.location %} + <div class="card__contact-info--location"> + <span class="uw-label">Location:</span> + {{ contact_info.location }} + </div> + {% endif %} + {% endblock %} + {% endembed %} +</div> diff --git a/source/_patterns/04-components/card/card-elements/_footer-elements.twig b/source/_patterns/04-components/card/card-elements/_footer-elements.twig new file mode 100644 index 0000000000000000000000000000000000000000..0ac071a2329e48c2b11d5ea545536294e482e43c --- /dev/null +++ b/source/_patterns/04-components/card/card-elements/_footer-elements.twig @@ -0,0 +1,41 @@ +{% if footer.additional_info %} + {% include '@components/card/card-elements/_additional-info.twig' with { + 'additional_info': footer.additional_info + } %} +{% endif %} + +{% if footer.contact_info %} + {% include '@components/card/card-elements/_contact-info.twig' with { + 'contact_info': footer.contact_info + } %} +{% endif %} + +{% if footer.links %} + {% include '@components/card/card-elements/_links.twig' with { + 'links': footer.links + }%} +{% endif %} + +{% if footer.location_info %} + {% include '@components/card/card-elements/_location-info.twig' with { + 'location_info': footer.location_info + }%} +{% endif %} + +{% if footer.contact_for %} + {% include '@components/card/card-elements/_contact-for.twig' with { + 'contact_for': footer.contact_for + } %} +{% endif %} + +{% if footer.groups %} + {% include '@components/card/card-elements/_groups.twig' with { + 'groups': footer.groups.groups + } %} +{% endif %} + +{% if footer.tags %} + {% include '@components/card/card-elements/_tags.twig' with { + 'tags': footer.tags, + } %} +{% endif %} diff --git a/source/_patterns/04-components/card/card-elements/_groups.twig b/source/_patterns/04-components/card/card-elements/_groups.twig new file mode 100644 index 0000000000000000000000000000000000000000..68efeb58a98565fcf5dd520ac7291f7da59f69ae --- /dev/null +++ b/source/_patterns/04-components/card/card-elements/_groups.twig @@ -0,0 +1,19 @@ +<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> diff --git a/source/_patterns/04-components/card/card-elements/_header.twig b/source/_patterns/04-components/card/card-elements/_header.twig index 8149c1b89f5d6523918a0350c47b4abb1e3a58b4..f5fb69180fa0befd18aa007b944cd399db59f153 100644 --- a/source/_patterns/04-components/card/card-elements/_header.twig +++ b/source/_patterns/04-components/card/card-elements/_header.twig @@ -15,7 +15,7 @@ {% if header.position %} {% include '@components/card/card-elements/_position.twig' with { - 'position': position + 'position': header.position } %} {% endif %} diff --git a/source/_patterns/04-components/card/card-elements/_links.twig b/source/_patterns/04-components/card/card-elements/_links.twig new file mode 100644 index 0000000000000000000000000000000000000000..77a0caab889c24573bc13ccd024f20d20ca4b2a9 --- /dev/null +++ b/source/_patterns/04-components/card/card-elements/_links.twig @@ -0,0 +1,26 @@ +<div class="card__contact-links"> + {% embed '@components/details/details.twig' %} + {% block details_summary %} + Links + {% endblock %} + + {% block details_content %} + {% if links.profile %} + <div class="card__link-profile"> + <span class="uw-label">Link to Profile:</span> + {% include '@components/links/links.twig' with { + 'links': links.profile + } %} + </div> + {% endif %} + {% if links.webpage %} + <div class="card__personal-webpage"> + <span class="uw-label">Link to personal webpage:</span> + {% include '@components/links/links.twig' with { + 'links': links.webpage + } %} + </div> + {% endif %} + {% endblock %} + {% endembed %} +</div> diff --git a/source/_patterns/04-components/card/card.twig b/source/_patterns/04-components/card/card.twig index 406bed8144fc6ef32dde5dc2c18186cde82f1aea..73e6c6594b72b9da60c85e970ee40d00665cc914 100644 --- a/source/_patterns/04-components/card/card.twig +++ b/source/_patterns/04-components/card/card.twig @@ -43,90 +43,9 @@ {% if footer %} <div class="card__footer"> - {% 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> - {% 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 footer.tags %} - {% include '@components/card/card-elements/_tags.twig' with { - 'tags': footer.tags, - } %} - {% endif %} + {% include '@components/card/card-elements/_footer-elements.twig' with { + 'footer': footer + } %} {% if read_more and url %} <div class="card__readmore">