templates/ProfileList/list.profiles.html.twig line 1

Open in your IDE?
  1. {% import '_macros/price_helpers.html.twig' as price_helpers %}
  2. {% set profileList = profileList is defined ? profileList : profiles %}
  3. {% set top_profile = profile_top_placement() %}
  4. {% set isTopProfilesExist = top_profile is defined and null != top_profile and null != profiles %}
  5. {% for profile in profileList %}
  6.     {% set profile = profile.profile is defined ? profile.profile : profile %}
  7.     {% set services = profile.providedServices %}
  8.     {%- set agePlural = '%age% лет'|trans({'lastnum': profile.personParameters.age|last}) -%}
  9.     {%- set ageText = profile.personParameters.age ~ ' ' ~ agePlural ~ ', ' -%}
  10.     {%- set cityText = '' -%}
  11.     {%- if city is defined and city != default_city() -%}
  12.         {%- set cityText = profile.city.name ~ ', ' -%}
  13.     {%- endif -%}
  14.     {%- set isSelfies = profile.selfies is iterable ? (profile.selfies|length > 0) : profile.selfies -%}
  15.     {%- set isVideos = profile.videos is iterable ? (profile.videos|length > 0) : profile.videos -%}
  16.     {%- set isComments = profile.comments is iterable ? (profile.comments|length > 0) : profile.comments -%}
  17.     {# {{dump(isTopProfilesExist)}} #}
  18.     {# {{dump( top_profile )}} #}
  19.     {%- if 'profile_list.list_by_station' in app.request.get('_route') -%}
  20.         {%- set station = app.request.attributes.get('station') -%}
  21.     {%- else -%}
  22.         {%- set station = profile.stations|first -%}
  23.     {%- endif -%}
  24.     {% set firstStation = '' -%}
  25.     {% set metroText = ''%}
  26.     {% if profile.stations|length > 0 -%}
  27.         {% set metroText = station is not null ? 'метро ' ~ station.name ~ ' в ' ~ profile.city.name|geo_name('дательный') ~ ', ' : '' -%}
  28.     {% endif -%}
  29.     {%- set morpID = profile.id -%}
  30.     {%- set serviceNameList = [] -%}
  31.     {% for service in services -%}
  32.         {% set serviceNameList = serviceNameList|merge([service.name]) %}
  33.     {% endfor %}
  34.     {%- set service1 = null -%}
  35.     {%- set service2 = null -%}
  36.     {% if serviceNameList is not empty %}
  37.         {%- set service1 = serviceNameList|seo_morphing(morpID) ~ ', ' -%}
  38.         {%- set service2 = serviceNameList|seo_morphing(morpID + 105) ~ ', ' -%}
  39.         {% if service1 == service2 -%}
  40.             {%- set service2 = serviceNameList|seo_morphing(morpID + 104) ~ ', ' -%}
  41.             {% if service1 == service2 -%}
  42.                 {%- set service2 = null -%}
  43.             {% endif %}
  44.         {% endif %}
  45.     {% endif %}
  46.     {% set isProfileTop = isTopProfilesExist and top_profile.uriIdentity == profile.uriIdentity %}
  47.     {% set isProfileVip = profile.isVip %}
  48.     {% set isProfileUltraVip = profile.isUltraVip %}
  49.     {% set labelHtml =
  50.         isProfileTop ?
  51.             '<div class="profile-item-label"><svg width="69" height="69"><use xlink:href="#icon-label-top"></use></svg></div>' :
  52.             (isProfileUltraVip ? '<div class="profile-item-label"><svg width="69" height="69"><use xlink:href="#icon-label-ultravip"></use></svg></div>' :
  53.                 (isProfileVip ? '<div class="profile-item-label"><svg width="69" height="69"><use xlink:href="#icon-label-vip"></use></svg></div>' : '')
  54.             )
  55.     %}
  56.     <div class="profiles-item-col"
  57.         data-ultra="{{isProfileUltraVip ?? null}}"
  58.         data-vip="{{isProfileVip ?? null}}"
  59.         data-standart="{{profile.isStandard ?? null}}"
  60.         data-active="{{profile.active}}"
  61.         data-hidden="{{profile.hidden}}"
  62.         data-approved="{{profile.isApproved}}"
  63.         data-profile-id="{{profile.id}}">
  64.         <div class="profiles-item">
  65.             {{ labelHtml|raw }}
  66.             <div class="profiles-item__content d-flex">
  67.                 {% if ( profile.isApproved ) %}
  68.                     <div class="profiles-item__verify" title="Фото проверено">
  69.                         <svg class="icon">
  70.                             <use xlink:href="#icon-models-list-verify"></use>
  71.                         </svg>
  72.                     </div>
  73.                 {% endif %}
  74.                 <a href="{{ path('profile_preview.page', {'city': profile.city.uriIdentity, 'profile': profile.uriIdentity}) }}" class="profiles-item__images d-block" target="_blank">
  75.                     {% set photo = profile|avatar %}
  76.                     {% if photo %}
  77.                         {% set alt = profile.name|trans ~ ', ' ~ ageText ~ cityText ~ metroText ~ (service1 is not null ? service1) ~ (service2 is not null ? service2) ~ (profile.seo.phone is defined ? "снять по тел. " ~ profile.seo.phone ~ ', ' : '') ~ 'анкета №' ~ profile.id %}
  78.                         <img data-src="{{ responsive_asset(photo.path, 'profile_media', "200x280", "jpg") }}"
  79.                             class="lazy img-fluid"
  80.                             alt="{{ alt }}"
  81.                             loading="lazy">
  82.                     {% endif %}
  83.                 </a>
  84.                 <div class="profiles-item__info flex-fill">
  85.                     <div class="profiles-item__header">
  86.                         <div class="profiles-item__header-title d-flex align-items-center">
  87.                             <a href="{{ path('profile_preview.page', {'city': profile.city.uriIdentity, 'profile': profile.uriIdentity}) }}" target="_blank">
  88.                                 {{ profile.name|trans }}
  89.                             </a>
  90.                         </div>
  91.                         {% if profile.isActive or not profile.isHidden %}
  92.                             {% set onlyPhoneNumber = profile.phoneNumber|replace({' ': '', '-': '', '(': '', ')': ''}) %}
  93.                             <button class="profiles-item__header-phone ml-auto" type="button" onclick="this.classList.add('d-none');this.nextElementSibling.classList.remove('d-none')">
  94.                                 <svg>
  95.                                     <use xlink:href="#icon-phone"></use>
  96.                                 </svg>
  97.                                 <span>Показать телефон</span>
  98.                             </button>
  99.                             <!--noindex--><a href="tel:{{ onlyPhoneNumber }}" rel="nofollow" class="profiles-item__header-phone ml-auto d-none">
  100.                                 <svg>
  101.                                     <use xlink:href="#icon-phone"></use>
  102.                                 </svg>
  103.                                 <span>{{- profile.phoneNumber -}}</span>
  104.                             </a><!--/noindex-->
  105.                         {% endif %}
  106.                     </div>
  107.                     {%- if station -%}
  108.                     <div class="item-info metro d-flex align-items-center">
  109.                         <svg class="icon mr-1">
  110.                             <use xlink:href="#icon-metro"></use>
  111.                         </svg>
  112.                         <a href="{{ path('profile_list.list_by_station', {'city': profile.city.uriIdentity, 'station': station.uriIdentity}) }}" target="_blank" title="{{ station.name }}">
  113.                             {{- station.name -}}
  114.                         </a>
  115.                     </div>
  116.                     {%- endif -%}
  117.                     <div class="item-info">
  118.                         <p class="d-flex align-items-center mb-1">
  119.                             Возраст:<span class="d-inline-block ml-auto">{{ profile.personParameters.age ? profile.personParameters.age : '-' }}</span>
  120.                         </p>
  121.                         <p class="d-flex align-items-center mb-1">
  122.                             Рост:<span class="d-inline-block ml-auto">{{ profile.personParameters.height ? profile.personParameters.height : '-' }}</span>
  123.                         </p>
  124.                         <p class="d-flex align-items-center mb-1">
  125.                             Вес:<span class="d-inline-block ml-auto">{{ profile.personParameters.weight ? profile.personParameters.weight : '-' }}</span>
  126.                         </p>
  127.                         <p class="d-flex align-items-center mb-1">
  128.                             Грудь:<span class="d-inline-block ml-auto">{{ profile.personParameters.breastSize ? profile.personParameters.breastSize : '-' }}</span>
  129.                         </p>
  130.                     </div>
  131.                     {%- set currencyProfile -%}{{ profile.city.countryCode|country_currency }}{%- endset -%}
  132.                     {%- set minPriceHour -%}{{ price_helpers._get_min(profile.apartmentsPricing.oneHourPrice,profile.takeOutPricing.oneHourPrice,currencyProfile) }}{%- endset -%}
  133.                     {%- set minPriceTwo -%}{{ price_helpers._get_min(profile.apartmentsPricing.twoHoursPrice,profile.takeOutPricing.twoHoursPrice,currencyProfile) }}{%- endset -%}
  134.                     {%- set minPriceNight -%}{{ price_helpers._get_min(profile.apartmentsPricing.nightPrice,profile.takeOutPricing.nightPrice,currencyProfile) }}{%- endset -%}
  135.                     {%- set hasOutPrice -%}{{- price_helpers._check_out_price(profile.takeOutPricing.oneHourPrice,profile.takeOutPricing.twoHoursPrice,profile.takeOutPricing.nightPrice) -}}{%- endset -%}
  136.                     <div class="item-info">
  137.                         <p class="d-flex align-items-center mb-1">
  138.                             Час:<span class="d-inline-block ml-auto description">{{ minPriceHour != '-' ? minPriceHour : '-' }}</span>
  139.                         </p>
  140.                         <p class="d-flex align-items-center mb-1">
  141.                             2 часа:<span class="d-inline-block ml-auto description">{{ minPriceTwo != '-' ? minPriceTwo : '-' }}</span>
  142.                         </p>
  143.                         <p class="d-flex align-items-center mb-1">
  144.                             Ночь:<span class="d-inline-block ml-auto description">{{ minPriceNight != '-' ? minPriceNight : '-' }}</span>
  145.                         </p>
  146.                         <p class="d-flex align-items-center mb-1">
  147.                             Экспресс:<span class="d-inline-block ml-auto description">{{ hasOutPrice == '1' ? 'Есть' : '-' }}</span>
  148.                         </p>
  149.                     </div>
  150.                 </div>
  151.                 <div class="profiles-item__status">
  152.                     {% if isSelfies %}
  153.                         <div class="status-item d-flex align-items-center justify-content-center" data-toggle="tooltip" data-placement="top" title="Есть селфи">
  154.                             <svg class="icon">
  155.                                 <use xlink:href="#icon-selfie-thumb"></use>
  156.                             </svg>
  157.                         </div>
  158.                     {% endif %}
  159.                     {% if isVideos %}
  160.                         <div class="status-item d-flex align-items-center justify-content-center" data-toggle="tooltip" data-placement="top" title="Есть видео">
  161.                             <svg class="icon">
  162.                                 <use xlink:href="#icon-video-thumb"></use>
  163.                             </svg>
  164.                         </div>
  165.                     {% endif %}
  166.                     {% if isComments %}
  167.                         <div class="status-item d-flex align-items-center justify-content-center" data-toggle="tooltip" data-placement="top" title="Есть комментарии">
  168.                             <svg class="icon">
  169.                                 <use xlink:href="#icon-comments-thumb"></use>
  170.                             </svg>
  171.                         </div>
  172.                     {% endif %}
  173.                 </div>
  174.             </div>
  175.         </div>
  176.     </div>
  177. {% endfor %}
  178. {%- if app.request.method == 'GET' and app.request.isXmlHttpRequest() -%}
  179.     {{- porpaginas_render(profiles) -}}
  180. {% endif %}