{% set user = app.user %}
{% set userName = user ? user.fullname : '' %}
{% set userEmail = user ? user.email : '' %}
{% set userPhone = user ? user.phoneNumber : '' %}
{% set countryCode = "+20" %}
{% set showSellerInfo = listing is defined and listing.category != SCRAPPED_LISTING_CATEGORY %}
{% if app.user and not user.phoneNumber starts with user.mainNumber.phone.countryCode %}
{% set countryCode = user.mainNumber.phone.countryCode %}
{% endif %}
{% set isAgentSearchPage = app.request.attributes.get('_route') in ['aqarmap_agents_search', 'aqarmap_agents_search_with_location', 'aqarmap_user_listings'] %}
{% set isCompanyProfilePage = isCompanyProfile is defined and isCompanyProfile %}
{% set companiesTab = currentTab is defined and currentTab == 'companies' %}
{% set isCompanyUserLeadMessage = companiesTab or isCompanyProfilePage %}
{% set formID = 'quickLeadForm' %}
{% set userHasEmail = userEmail|length > 0 ? true : false %}
{% set phonePlaceholder = 'popup_form.register_popup_phone_number'|trans ~ '*' %}
{% set namePlaceholder = 'layout.static_placeholders.name_placeholder'|trans %}
{% if isEnabledFeature('web.small.registration') %}
{% set namePlaceholder = 'popup_form.register_popup_name'|trans ~ '*' %}
{% endif %}
<div class="modal bd-example-modal-lg countryCode quick-lead-modal small easy-access"
id="listing-quick-lead-modal"
tabindex="-1"
role="dialog"
{% if app.user %}
ng-init="setLoggedInUser({
'name': '{{ userName }}',
'email': '{{ userEmail }}',
'phone': '{{ userPhone }}',
'countryCode': '{{ user.mainNumber.phone.countryCode }}'
})"
{% else %}
ng-init="setLoggedInUser(null)"
{% endif %}
>
<div class="modal-dialog" role="document" >
<div class="modal-header modal-lg">
{% if isEnabledFeature('web.registration.survey') %}
<button type="button"
class="close-absolute"
ng-click="closeModelEvent('gtm-btn-registeration-closed')"
data-dismiss="modal"
data-toggle="modal"
data-target="#RegistrationSurveyModal"
aria-label="Close"
>
<span>x</span>
</button>
{% else %}
<button type="button"
class="close-absolute"
data-dismiss="modal"
aria-label="Close"
>
<span>x</span>
</button>
{% endif %}
<span class="modal-title model-header-title">
{% if isAgentSearchPage %}
{% if isCompanyUserLeadMessage %}
{{ 'agents_search_page.company_user_lead_message'|trans }}
{% else %}
{{ 'agents_search_page.agent_user_lead_message'|trans }}
{% endif %}
{% else %}
{{ 'listing.lead_message'|trans }}
{% endif %}
</span>
</div>
<div class="modal-content modal-lg">
{{ form_start(form, {'attr': {'id': formID}}) }}
<div class="modal-body">
<div class="modal-listing-contact">
<div class="full-height">
<div class="col-xs-12 contact-container full-height"
ng-init="setAutoGeneratedEmailStatus({{ isEnabledFeature('web.small.registration') }})">
<div class="form-group">
{{ form_widget(form.name, {'attr':{'class': 'form-control','value': userName, 'placeholder': namePlaceholder}}) }}
{{ form_errors(form.name) }}
</div>
{% if not isEnabledFeature('web.small.registration') %}
<div class="form-group">
{{ form_widget(form.email, {'attr':{
'class': 'form-control',
'value': userEmail,
'placeholder': 'layout.static_placeholders.email_placeholder'|trans,
}})
}}
<span id="emailError" class="text-danger modalError email-error"></span>
</div>
{% else %}
<div class="form-group"
ng-class="{'m-0': !showEmail}">
<input type="email"
id="lead_email"
name="lead[email]"
required="required"
class="form-control"
ng-class="{'d-none': !showEmail}"
ng-value="!showEmail ? 'user+@aqarmap.com' : ''"
placeholder="{{ 'layout.static_placeholders.email_placeholder'|trans }}"
/>
<span id="emailError" class="text-danger modalError email-error" ng-class="{'d-none': !showEmail}"></span>
</div>
{% endif %}
<div class="form-group mb-0" ng-init="setUserNumber({{ userPhone }})">
{{ form_widget(form.phone ,{'attr':{
'ng-model': 'userNumber',
'class': 'form-control phone',
'ng-value': userPhone,
'placeholder': phonePlaceholder
}})
}}
{{ form_errors(form.phone) }}
<span id="phoneError" class="text-danger modalError phone-error"></span>
<input
type="hidden"
id="leadCountryCode"
class="form-control"
name="countryCode"
value="{{ countryCode }}"
/>
</div>
<input type="hidden"
id="userEmailIsAdded"
class="form-control"
name="userEmailIsAdded"
ng-value="userEmailIsAdded"
/>
</div>
</div>
</div>
</div>
<div class="modal-footer text-center">
<div class="form-group lead-submit mb-0 mx-auto w-100">
<button type="submit"
id="quickLeadButton"
class="btn btn-submit btn-primary btn-footer"
name="_submit"
>
<i id="loginSpinner"></i> {{ 'popup_form.proceed'|trans }}
</button>
</div>
</div>
{{ form_end(form, {'render_rest': false}) }}
</div>
</div>
</div>