{% macro item(taxon) %}
{% import _self as macros %}
{% set children = taxon.getEnabledChildrenByTranslationName(taxon.translation.locale) %}
{% if children|length > 0 %}
<div class="ui simple dropdown item">
<a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, 'products':'products'|trans, 'product_category':'product_category'|trans, '_locale': taxon.translation.locale}) }}" data-js="menu-link" class="menu-dropdown-link">
<span class="text text-sm">{{ taxon.name }}</span>
<span class="material-symbols-outlined">expand_more</span>
</a>
<div class="menu hyfindr-column-menu"
{% if taxon.slug == 'components' %}
style="grid-template-rows: repeat(15, 1fr);"
{% elseif children|length < 12 %}
style="grid-template-rows: repeat({{ taxon.enabledChildren|length }}, 1fr)"
{% endif %}>
{% for childTaxon in children %}
{{ macros.nested_item(childTaxon) }}
{% endfor %}
</div>
</div>
{% else %}
<a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, 'products':'products'|trans, 'product_category':'product_category'|trans, '_locale': taxon.translation.locale}) }}" class="item text text-sm">{{ taxon.name }}</a>
{% endif %}
{% endmacro %}
{% macro nested_item(taxon) %}
{% import _self as macros %}
{% set children = taxon.getEnabledChildrenByTranslationName(taxon.translation.locale) %}
{% if children|length > 0 %}
<div class="item nested_item">
<a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, 'products':'products'|trans, 'product_category':'product_category'|trans, '_locale': taxon.translation.locale}) }}">
<span class="text">{{ taxon.name }}</span>
<span class="material-symbols-outlined">expand_more</span>
</a>
<div class="menu right hyfindr-column-menu" {% if children|length < 12 %}style="grid-template-rows: repeat({{ taxon.enabledChildren|length }}, 1fr)"{% endif %}>
{% for childTaxon in children %}
{{ macros.nested_item(childTaxon) }}
{% endfor %}
</div>
</div>
{% else %}
<a href="{{ path('bitbag_sylius_elasticsearch_plugin_shop_list_products', {'slug': taxon.slug, 'products':'products'|trans, 'product_category':'product_category'|trans, '_locale': taxon.translation.locale}) }}" class="item nested_item text text-sm">{{ taxon.name }}</a>
{% endif %}
{% endmacro %}
{% import _self as macros %}
{% set registerProductsLink = url('bitbag_sylius_organization_plugin_shop_register_organization_vendor') %}
{% if is_granted('ROLE_USER') %}
{% if app.user.customer.organization.vendor|default(null) == null %}
{% set registerProductsLink = url('open_marketplace_vendor_register_form') %}
{% else %}
{% set registerProductsLink = url('open_marketplace_vendor_product_listings_index') %}
{% endif %}
{% endif %}
<div class="menu-bar desktop-menu">
{% if taxons|length > 0 %}
<div class="ui large stackable menu horizontal-menu">
{% if get_current_route_name() not in ['app_tech_videos', 'app_tech_advisory', 'app_tech_knowledge', 'app_crfq_create', 'bitbag_organization_shop_user_request_search', 'bitbag_organization_shop_user_request_join_or_claim'] %}
{% for taxon in taxons if true == taxon.enabled %}
{{ macros.item(taxon) }}
{% endfor %}
{{ render(path('open_marketplace_shop_render_country_menu', {'template': 'Context/Shop/Menu/country.html.twig'})) }}
{{ render(path('open_marketplace_shop_render_use_case_menu', {'template': 'Context/Shop/Menu/useCases.html.twig'})) }}
<a href="{{ path('open_marketplace_shop_vendor_index') }}" class="item text-sm">{{ 'app.ui.brands'|trans }}</a>
{% elseif get_current_route_name() in ['app_crfq_create', 'bitbag_organization_shop_user_request_search', 'bitbag_organization_shop_user_request_join_or_claim'] %}
{% include 'Context/Suppliers/horizontalMenu.html.twig' %}
{% elseif get_current_route_name() == 'app_tech_videos' %}
{% include 'Context/TechVideos/horizontalMenu.html.twig' %}
{% elseif get_current_route_name() == 'app_tech_advisory' %}
{% include 'Context/TechAdvisory/horizontalMenu.html.twig' %}
{% elseif get_current_route_name() == 'app_tech_knowledge' %}
{% include 'Context/TechKnowledge/horizontalMenu.html.twig' %}
{% endif %}
</div>
{% endif %}
{% if get_current_route_name() == 'app_crfq_create' %}
<a href="{{ path('sylius_shop_contact_request', {'company': 'company'|trans})}}" class="hyfindr btn btn--primary header-button capitalize right floated">{{ 'app.ui.contact_uns'|trans }}</a>
{% else %}
<a href="{{ registerProductsLink }}" class="hyfindr btn btn--primary header-button capitalize right floated">{{ 'app.ui.register_products'|trans }}</a>
{% endif %}
</div>