{% if not isCompaniesDataParamsDefined is defined %}
{% set attrPropertyType = app.request.attributes.get('propertyType') %}
{% set attrPropertyTypeId = propertyType is defined ? propertyType.id : null %}
{% set listingPropertyType = listing is defined ? listing.propertyType : null %}
{% set listingPropertyTypeId = listingPropertyType ? listingPropertyType.id : 'null' %}
{% set attrSection = app.request.attributes.get('section') %}
{% set attrSectionId = section is defined ? section.id : null %}
{% set listingSection = listing is defined ? listing.section : null %}
{% set listingSectionId = listingSection ? listingSection.id : 'null' %}
{% set paramLocation = app.request.query.get('location')%}
{% set paramLocationId = paramLocation ? paramLocation : null %}
{% set attrLocation = app.request.attributes.get('location')%}
{% set attrLocationId = attrLocation ? attrLocation.id : null %}
{% set listingLocation = listing is defined ? listing.location : null %}
{% set listingLocationId = listingLocation ? listingLocation.id : 'null' %}
{% set locationId = attrLocationId ? attrLocationId: (paramLocationId ? paramLocationId : listingLocationId) %}
{% set propertyTypeId = attrPropertyTypeId ? attrPropertyTypeId : listingPropertyType %}
{% set sectionId = attrSectionId ? attrSectionId : listingSectionId %}
{% endif %}
{% set leadSourcePage = leadSourcePage is defined ? leadSourcePage : "search_results"%}
<div class="top-sellers w-100"
ng-controller="FeaturedCompaniesController">
<div ng-content-loaded callback="setTopCompaniesData({
'propertyType':'{{propertyTypeId}}',
'section':'{{sectionId}}',
'location': '{{locationId}}'});
fetchFeaturedCompanies();"
>
<div class="top-sellers-container section-wrapper section-wrapper__bordered_flex" ng-if="!isTopCompaniesEmpty()" ng-cloak>
<div class="top-sellers-container__header">
{% if location is not null %}
<h2 class="section-title__header-with-sub">{{ 'top_sellers.real_estate'|trans({"%location%": location.title}) }}</h2>
<section class="section-title__sub-header">{{ 'top_sellers.sub_text_location'|trans({"%location%": location.title}) }}</section>
{% else %}
<h2 class="section-title__header-with-sub">{{ 'top_sellers.real_estate_empty'|trans }}</h2>
<section class="section-title__sub-header">{{ 'top_sellers.sub_text'|trans }}</section>
{% endif %}
</div>
<div class="top-sellers-details">
<div class="cards-list">
<div class="user-card" ng-repeat="company in getTopCompanies()">
<div class="user-card__details" >
<div class="user-card__info d-flex">
<div class="user-card__checkbox">
{% set cardsPosition = position is defined ? position : "vertical" %}
<input type="checkbox" class="styled-checkbox"
id="company-{{'ng::company.user.id::'}}-{{cardsPosition}}"
ng-model="companiesChecked[company.user.id]"
ng-value="company.user.id" value="company.user.id"
ng-init="companiesChecked[company.user.id] = true"
ng-checked="true"/>
<label class="m-0" for="company-{{'ng::company.user.id::'}}-{{cardsPosition}}"></label>
</div>
<div class="user-card__img-container">
{% set thumb = 'ng::company.user.logo.thumbnails.thumb::' %}
<img ng-if="company.user.logo" class="user-card__img" src="{{thumb}}" alt="logo">
<img ng-if="!company.user.logo" class="user-card__img user-card__img_empty" src="{{ asset('images/emblem.svg') }}" alt="logo">
</div>
<div class="user-card__data">
<div class="user-card__name">
<b class="user-card__name-text" title=""
ng-bind="company.user.full_name"
ng-class="getSellerNameDir(company.user.full_name)"></b>
</div>
<div class="user-card__stat">
<label class="user-card__joined-text w-auto" ng-if="company.numberOfActiveListing > 0">
<span ng-bind="getFormattedNumber(company.numberOfActiveListing)"></span>
<span>
{{ 'labels.listings'|trans }}
</span>
</label>
<label class="user-card__joined-text w-auto" ng-if="company.leadsCount > 0">
<span ng-bind="getFormattedNumber(company.leadsCount)"></span>
<span>
{{ 'labels.clients_served'|trans }}
</span>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="w-100">
<button
type="submit"
class="btn btn-primary cta-btn-vertical cards-list__footer-btn"
ng-show="showButton()"
ng-click="onSendRequest($event,'{{ trigger }}', '{{ eventAction }}', {
leadSourcePage: '{{leadSourcePage}}' ,
});"
>
{{ 'label.lead.call_request' | trans }}
</button>
</div>
<div>
<div class="alert alert-dismissable alert-success" ng-show="!showButton()">
{{ 'listing.top_seller_success_call_request'| trans }}
</div>
</div>
</div>
{% include "@AqarmapListing/ListingSearch/featuredCompaniesModal.html.twig" %}
</div>
</div>
</div>