{% extends '@SyliusShop/layout.html.twig' %}
{% import '@SyliusUi/Macro/pagination.html.twig' as pagination %}
{% import '@SyliusUi/Macro/messages.html.twig' as messages %}
{% form_theme form with ['@SyliusUi/Form/theme.html.twig', 'Context/Shop/ProductCategory/formTheme.html.twig'] %}
{% set reviewsCount = 0 %}
{% set hasFullSupplierInfo = vendor.organization ? isFullSupplierInfo(vendor.organization) : false %}
{% block content %}
<div class="ui clearing hidden divider"></div>
{% if is_mobile() %}
{% set vendor_banner_width = 330 %}
{% set vendor_banner_height = 550 %}
{% else %}
{% set vendor_banner_width = 1136 %}
{% set vendor_banner_height = 300 %}
{% endif %}
<div class="ui stackable grid vendor__view">
<div class="sixteen wide column vendor-banner">
{% if hasFullSupplierInfo and vendor.getBackgroundImage is not null %}
<img id="vendor_banner"
src="{{ aws_s3_base_url ~ '/media/cache/hyfindr_original/' ~ vendor.getBackgroundImage.path }}"
alt="{{ vendor.companyName }} banner"
width="{{ vendor_banner_width }}" height="{{ vendor_banner_height }}"
>
{% endif %}
<h1 class="ui monster section dividing header">
<div class="vendor-products--vendor-name{% if not hasOwner and vendor.organization %} has-takeover-btn{% endif %}">
{% if hasFullSupplierInfo and vendor.getImage is not null %}
<div class="vendor-logo">
<img id="vendor_logo"
src="{{ aws_s3_base_url ~ '/media/cache/hyfindr_original/' ~ vendor.getImage.path }}"
alt="{{ vendor.companyName }} logo"
width="70" height="70"
>
</div>
{% endif %}
<div class="text-4xl">
{{ vendor.companyName }}
{% if hasFullSupplierInfo %}
<div class="vendor-icons">
{% include '@SyliusShop/Product/_vendorBadgeIcons.html.twig' %}
</div>
{% endif %}
</div>
{% if not hasOwner and vendor.organization %}
<a href="{{ path('bitbag_organization_shop_user_request_join_or_claim', {'uuid': vendor.organization.uuid}) }}" class="hyfindr btn btn--primary take-over-button">
<i class="user plus icon"></i>
{{ 'app.ui.take_over_account'|trans }}
</a>
{% endif %}
</div>
{% set isBot = app.request.attributes.get('is_bot') %}
{% set vendorAddress = vendor.vendorAddress %}
{% if vendorAddress and not isBot %}
<div class="text-lg font-normal text-left vendor-address">
{{ vendorAddress.street }}, {{ vendorAddress.postalCode }} {{ vendorAddress.city }}, {{ vendorAddress.country }}
</div>
{% endif %}
{% if vendor.termsOfService %}
<div class="text-sm font-normal text-left">
<a href="{{ vendor.termsOfService }}" target="_blank" class="vendors-terms">{{ 'app.ui.terms_and_conditions' | trans }}</a>
</div>
{% endif %}
<div class="vendor-products--vendor-description text-lg font-normal text-left expandable-content-container">
{% if not vendor.translation.isReviewed and app.request.locale not in ['en', 'de'] %}
<a class="ui ribbon label ai-label">{{ 'app.ui.brands_page.ai_generated' | trans }}</a>
{% endif %}
<span class="expandable-content">{{ vendor.description | raw }}</span>
</div>
</h1>
</div>
</div>
{{ form_start(form, {'method': 'GET', 'attr': {'class': 'ui loadable form'}}) }}
{# Mobile Filter Toggle Button #}
{% include 'bundles/BitBagSyliusElasticsearchPlugin/Shop/Filters/mobileFilters.twig' with {'filterForm': form} %}
<div class="ui stackable grid">
<div class="four wide column">
{% embed 'bundles/BitBagSyliusElasticsearchPlugin/Shop/Filters/filters.twig' with {
'filterForm': form,
'resetUrl': path('open_marketplace_shop_vendor_page_index', {'vendor_slug': vendor.slug})
} %}
{% block formContent %}
{{ form_row(form.filters) }}
{% endblock %}
{% endembed %}
</div>
<div class="twelve wide column">
{% if products|length > 0 %}
<div class="category-products-grid store-page" id="products">
{% for product in products %}
<div class="column">
{% include '@SyliusShop/Product/_box.html.twig' %}
</div>
{% endfor %}
</div>
<div class="ui hidden divider"></div>
{{ pagination.simple(products) }}
{% else %}
{{ messages.info('sylius.ui.no_results_to_display') }}
{% endif %}
</div>
</div>
<button type="submit" style="display: none">
<i class="search icon"></i>
{{ 'bitbag_sylius_elasticsearch_plugin.ui.filter'|trans }}
</button>
{{ form_end(form, {'render_rest': false}) }}
<div class="ui clearing hidden divider"></div>
<script>
window.translations = {
readMore: "{{ 'app.ui.read_more'|trans|lower }}",
readLess: "{{ 'app.ui.read_less'|trans|lower }}"
};
</script>
{% endblock %}