templates/bundles/SyliusShopBundle/Taxon/_horizontalMenu.html.twig line 51

Open in your IDE?
  1. {% macro item(taxon) %}
  2.     {% import _self as macros %}
  3.     {% set children = taxon.getEnabledChildrenByTranslationName(taxon.translation.locale) %}
  4.     {% if children|length > 0 %}
  5.         <div class="ui simple dropdown item">
  6.             <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">
  7.                 <span class="text text-sm">{{ taxon.name }}</span>
  8.                 <span class="material-symbols-outlined">expand_more</span>
  9.             </a>
  10.             <div class="menu hyfindr-column-menu" 
  11.                 {% if taxon.slug == 'components' %}
  12.                     style="grid-template-rows: repeat(15, 1fr);"
  13.                 {% elseif children|length < 12 %}
  14.                     style="grid-template-rows: repeat({{ taxon.enabledChildren|length }}, 1fr)"
  15.                 {% endif %}>
  16.                 
  17.                 {% for childTaxon in children %}
  18.                     {{ macros.nested_item(childTaxon) }}
  19.                 {% endfor %}
  20.             </div>
  21.         </div>
  22.     {% else %}
  23.         <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>
  24.     {% endif %}
  25. {% endmacro %}
  26. {% macro nested_item(taxon) %}
  27.     {% import _self as macros %}
  28.     {% set children = taxon.getEnabledChildrenByTranslationName(taxon.translation.locale) %}
  29.     {% if children|length > 0 %}
  30.             <div class="item nested_item">
  31.                 <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}) }}">
  32.                     <span class="text">{{ taxon.name }}</span>
  33.                     <span class="material-symbols-outlined">expand_more</span>
  34.                 </a>
  35.                 <div class="menu right hyfindr-column-menu" {% if children|length < 12 %}style="grid-template-rows: repeat({{ taxon.enabledChildren|length }}, 1fr)"{% endif %}>
  36.                     {% for childTaxon in children %}
  37.                         {{ macros.nested_item(childTaxon) }}
  38.                     {% endfor %}
  39.                 </div>
  40.             </div>
  41.     {% else %}
  42.         <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>
  43.     {% endif %}
  44. {% endmacro %}
  45. {% import _self as macros %}
  46. {% set registerProductsLink = url('bitbag_sylius_organization_plugin_shop_register_organization_vendor') %}
  47. {% if is_granted('ROLE_USER') %}
  48.     {% if app.user.customer.organization.vendor|default(null) == null %}
  49.         {% set registerProductsLink = url('open_marketplace_vendor_register_form') %}
  50.     {% else %}
  51.         {% set registerProductsLink = url('open_marketplace_vendor_product_listings_index') %}
  52.     {% endif %}
  53. {% endif %}
  54. <div class="menu-bar desktop-menu">
  55.     {% if taxons|length > 0 %}
  56.         <div class="ui large stackable menu horizontal-menu">
  57.             {% if get_current_route_name() not in ['app_tech_videos', 'app_tech_advisory', 'app_tech_knowledge'] %}
  58.                 {% for taxon in taxons if true == taxon.enabled %}
  59.                     {{ macros.item(taxon) }}
  60.                 {% endfor %}
  61.                 {{ render(path('open_marketplace_shop_render_country_menu', {'template': 'Context/Shop/Menu/country.html.twig'})) }}
  62.                 {{ render(path('open_marketplace_shop_render_use_case_menu', {'template': 'Context/Shop/Menu/useCases.html.twig'})) }}
  63.                 <a href="{{ path('open_marketplace_shop_vendor_index') }}" class="item text-sm">{{ 'app.ui.brands'|trans }}</a>
  64.             {% elseif get_current_route_name() == 'app_tech_videos' %}
  65.                 {% include 'Context/TechVideos/horizontalMenu.html.twig' %}
  66.             {% elseif get_current_route_name() == 'app_tech_advisory' %}
  67.                 {% include 'Context/TechAdvisory/horizontalMenu.html.twig' %}
  68.             {% elseif get_current_route_name() == 'app_tech_knowledge' %}
  69.                 {% include 'Context/TechKnowledge/horizontalMenu.html.twig' %}
  70.             {% endif %}
  71.         </div>
  72.     {% endif %}
  73.     <a href="{{ registerProductsLink }}" class="hyfindr btn btn--primary header-button capitalize">{{  'app.ui.register_products'|trans }}</a>
  74. </div>