diff --git a/src/patterns/04-components/multi-type-list/multi-type-list.twig b/src/patterns/04-components/multi-type-list/multi-type-list.twig index 103891c47613ba1e3fbfba076f0ae36a927d3232..83c07083aff03025ede5f4508f0c02cf50b671da 100644 --- a/src/patterns/04-components/multi-type-list/multi-type-list.twig +++ b/src/patterns/04-components/multi-type-list/multi-type-list.twig @@ -3,107 +3,109 @@ {% set content_list = content_list|merge([type]) %} {% endfor %} -{% set button_modifier_classes -%} - button button--large {{ modifier_classes }} -{%- endset %} +{% if content_list %} + {% set button_modifier_classes -%} + button button--large {{ modifier_classes }} + {%- endset %} -{% embed '@components/tabs/_tabs.twig' with { - 'tab_type': 'content', - 'content_list': content_list, - 'button_modifier_classes': button_modifier_classes, -} %} -{% if is_demo %} - {% set view_all = 'true' %} - {% endif %} - {% for type, list in lists %} - {% for info in list %} + {% embed '@components/tabs/_tabs.twig' with { + 'tab_type': 'content', + 'content_list': content_list, + 'button_modifier_classes': button_modifier_classes, + } %} + {% if is_demo %} + {% set view_all = 'true' %} + {% endif %} + {% for type, list in lists %} + {% for info in list %} - {% if loop.parent.loop.index == 1 %} - {% block content_area_1 %} - {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with { - 'type': type, - 'lists': lists, - } %} - {% if view_all %} - <div class="uw-multi-type-list__button"> - {% include '@components/button/button.twig' with { - 'url': view_all[type].url, - 'text': view_all[type].text, - } %} - </div> - {% endif %} - {% endblock %} - {% elseif loop.parent.loop.index == 2 %} - {% block content_area_2 %} - {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with { - 'type': type, - 'lists': lists, - 'view_all': view_all, - } %} - {% if view_all %} - <div class="uw-multi-type-list__button"> - {% include '@components/button/button.twig' with { - 'url': view_all[type].url, - 'text': view_all[type].text, - } %} - </div> - {% endif %} - {% endblock %} - {% elseif loop.parent.loop.index == 3 %} - {% block content_area_3 %} - {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with { - 'type': type, - 'lists': lists, - 'view_all': view_all, - } %} - {% if view_all %} - <div class="uw-multi-type-list__button"> - {% include '@components/button/button.twig' with { - 'url': view_all[type].url, - 'text': view_all[type].text, - } %} - </div> - {% endif %} - {% endblock %} + {% if loop.parent.loop.index == 1 %} + {% block content_area_1 %} + {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with { + 'type': type, + 'lists': lists, + } %} + {% if view_all %} + <div class="uw-multi-type-list__button"> + {% include '@components/button/button.twig' with { + 'url': view_all[type].url, + 'text': view_all[type].text, + } %} + </div> + {% endif %} + {% endblock %} + {% elseif loop.parent.loop.index == 2 %} + {% block content_area_2 %} + {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with { + 'type': type, + 'lists': lists, + 'view_all': view_all, + } %} + {% if view_all %} + <div class="uw-multi-type-list__button"> + {% include '@components/button/button.twig' with { + 'url': view_all[type].url, + 'text': view_all[type].text, + } %} + </div> + {% endif %} + {% endblock %} + {% elseif loop.parent.loop.index == 3 %} + {% block content_area_3 %} + {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with { + 'type': type, + 'lists': lists, + 'view_all': view_all, + } %} + {% if view_all %} + <div class="uw-multi-type-list__button"> + {% include '@components/button/button.twig' with { + 'url': view_all[type].url, + 'text': view_all[type].text, + } %} + </div> + {% endif %} + {% endblock %} - {% elseif loop.parent.loop.index == 4 %} - {% block content_area_4 %} - {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with { - 'type': type, - 'lists': lists, - 'view_all': view_all, - } %} - {% if view_all %} - <div class="uw-multi-type-list__button"> - {% include '@components/button/button.twig' with { - 'url': view_all[type].url, - 'text': view_all[type].text, - } %} - </div> - {% endif %} - {% endblock %} + {% elseif loop.parent.loop.index == 4 %} + {% block content_area_4 %} + {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with { + 'type': type, + 'lists': lists, + 'view_all': view_all, + } %} + {% if view_all %} + <div class="uw-multi-type-list__button"> + {% include '@components/button/button.twig' with { + 'url': view_all[type].url, + 'text': view_all[type].text, + } %} + </div> + {% endif %} + {% endblock %} - {% elseif loop.parent.loop.index == 5 %} - {% block content_area_5 %} - {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with { - 'type': type, - 'lists': lists, - 'view_all': view_all, - } %} - {% if view_all %} - <div class="uw-multi-type-list__button"> - {% include '@components/button/button.twig' with { - 'url': view_all[type].url, - 'text': view_all[type].text, - } %} - </div> - {% endif %} - {% endblock %} + {% elseif loop.parent.loop.index == 5 %} + {% block content_area_5 %} + {% include '@components/multi-type-list/_multi-tab-list-include-content.twig' with { + 'type': type, + 'lists': lists, + 'view_all': view_all, + } %} + {% if view_all %} + <div class="uw-multi-type-list__button"> + {% include '@components/button/button.twig' with { + 'url': view_all[type].url, + 'text': view_all[type].text, + } %} + </div> + {% endif %} + {% endblock %} - {% endif %} + {% endif %} - {% endfor %} + {% endfor %} - {% endfor %} + {% endfor %} -{% endembed %} + {% endembed %} +{% endif %}