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. {% for profile in profileList %}
  4.     {% set profile = profile.profile is defined ? profile.profile : profile %}
  5.     {% set services = profile.providedServices %}
  6.     {%- set agePlural = '%age% лет'|trans({'lastnum': profile.personParameters.age|last}) -%}
  7.     {%- set ageText = profile.personParameters.age ~ ' ' ~ agePlural ~ ', ' -%}
  8.     {%- set cityText = '' -%}
  9.     {%- if city is defined and city != default_city() -%}
  10.         {%- set cityText = profile.city.name ~ ', ' -%}
  11.     {%- endif -%}
  12.     {%- set isSelfies = profile.selfies is iterable ? (profile.selfies|length > 0) : profile.selfies -%}
  13.     {%- set isVideos = profile.videos is iterable ? (profile.videos|length > 0) : profile.videos -%}
  14.     {%- set isComments = profile.comments is iterable ? (profile.comments|length > 0) : profile.comments -%}
  15.     {%- if 'profile_list.list_by_station' in app.request.get('_route') -%}
  16.         {%- set station = app.request.attributes.get('station') -%}
  17.     {%- else -%}
  18.         {%- set station = profile.stations|first -%}
  19.     {%- endif -%}
  20.     {% set firstStation = '' -%}
  21.     {% set metroText = ''%}
  22.     {% if profile.stations|length > 0 -%}
  23.         {% set metroText = station is not null ? 'метро ' ~ station.name ~ ' в ' ~ profile.city.name|geo_name('дательный') ~ ', ' : '' -%}
  24.     {% endif -%}
  25.     {%- set morpID = profile.id -%}
  26.     {%- set serviceNameList = [] -%}
  27.     {% for service in services -%}
  28.         {% set serviceNameList = serviceNameList|merge([service.name]) %}
  29.     {% endfor %}
  30.     {%- set service1 = null -%}
  31.     {%- set service2 = null -%}
  32.     {% if serviceNameList is not empty %}
  33.         {%- set service1 = serviceNameList|seo_morphing(morpID) ~ ', ' -%}
  34.         {%- set service2 = serviceNameList|seo_morphing(morpID + 105) ~ ', ' -%}
  35.         {% if service1 == service2 -%}
  36.             {%- set service2 = serviceNameList|seo_morphing(morpID + 104) ~ ', ' -%}
  37.             {% if service1 == service2 -%}
  38.                 {%- set service2 = null -%}
  39.             {% endif %}
  40.         {% endif %}
  41.     {% endif %}
  42.     <div class="profiles-item-col"
  43.         data-ultra="{{profile.isUltraVip ?? null}}"
  44.         data-vip="{{profile.isVip ?? null}}"
  45.         data-standart="{{profile.isStandard ?? null}}"
  46.         data-active="{{profile.active}}"
  47.         data-hidden="{{profile.hidden}}"
  48.         data-approved="{{profile.isApproved}}"
  49.         data-profile-id="{{profile.id}}">
  50.         <div class="profiles-item">
  51.             <div class="profiles-item__content d-flex">
  52.                 {% if ( profile.isApproved ) %}
  53.                     <div class="profiles-item__verify" title="Фото проверено">
  54.                         <svg class="icon">
  55.                             <use xlink:href="#icon-models-list-verify"></use>
  56.                         </svg>
  57.                     </div>
  58.                 {% endif %}
  59.                 <a href="{{ path('profile_preview.page', {'city': profile.city.uriIdentity, 'profile': profile.uriIdentity}) }}" class="profiles-item__images d-block" target="_blank">
  60.                     {% set photo = profile|avatar %}
  61.                     {% if photo %}
  62.                         {% 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 %}
  63.                         <img data-src="{{ responsive_asset(photo.path, 'profile_media', "200x280", "jpg") }}"
  64.                             class="lazy img-fluid"
  65.                             alt="{{ alt }}"
  66.                             loading="lazy">
  67.                     {% endif %}
  68.                 </a>
  69.                 <div class="profiles-item__info flex-fill">
  70.                     <div class="profiles-item__header">
  71.                         <div class="profiles-item__header-title d-flex align-items-center">
  72.                             <a href="{{ path('profile_preview.page', {'city': profile.city.uriIdentity, 'profile': profile.uriIdentity}) }}" target="_blank">
  73.                                 {{ profile.name|trans }}
  74.                             </a>
  75.                         </div>
  76.                         {% if profile.isActive or not profile.isHidden %}
  77.                             {% set onlyPhoneNumber = profile.phoneNumber|replace({' ': '', '-': '', '(': '', ')': ''}) %}
  78.                             <button class="profiles-item__header-phone ml-auto" type="button" onclick="this.classList.add('d-none');this.nextElementSibling.classList.remove('d-none')">
  79.                                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none"><path fill="#F27900" d="m15.7 12.53-3.64-3.32a.9.9 0 0 0-1.25.04l-2.15 2.21a5.16 5.16 0 0 1-2.63-1.49 5.13 5.13 0 0 1-1.5-2.63L6.76 5.2a.9.9 0 0 0 .03-1.25L3.47.3A.9.9 0 0 0 2.22.22L.27 1.89a.9.9 0 0 0-.26.58c-.02.23-.27 5.54 3.85 9.67a13.6 13.6 0 0 0 9.67 3.85.9.9 0 0 0 .58-.26l1.67-1.95a.9.9 0 0 0-.07-1.25Z"/></svg>
  80.                                 <span>Показать телефон</span>
  81.                             </button>
  82.                             <!--noindex--><a href="tel:{{ onlyPhoneNumber }}" rel="nofollow" class="profiles-item__header-phone ml-auto d-none">
  83.                                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none"><path fill="#F27900" d="m15.7 12.53-3.64-3.32a.9.9 0 0 0-1.25.04l-2.15 2.21a5.16 5.16 0 0 1-2.63-1.49 5.13 5.13 0 0 1-1.5-2.63L6.76 5.2a.9.9 0 0 0 .03-1.25L3.47.3A.9.9 0 0 0 2.22.22L.27 1.89a.9.9 0 0 0-.26.58c-.02.23-.27 5.54 3.85 9.67a13.6 13.6 0 0 0 9.67 3.85.9.9 0 0 0 .58-.26l1.67-1.95a.9.9 0 0 0-.07-1.25Z"/></svg>
  84.                                 <span>{{- profile.phoneNumber -}}</span>
  85.                             </a><!--/noindex-->
  86.                         {% endif %}
  87.                     </div>
  88.                     {%- if station -%}
  89.                     <div class="item-info metro d-flex align-items-center">
  90.                         <svg class="icon mr-1">
  91.                             <use xlink:href="#icon-metro"></use>
  92.                         </svg>
  93.                         <a href="{{ path('profile_list.list_by_station', {'city': profile.city.uriIdentity, 'station': station.uriIdentity}) }}" target="_blank" title="{{ station.name }}">
  94.                             {{- station.name -}}
  95.                         </a>
  96.                     </div>
  97.                     {%- endif -%}
  98.                     <div class="item-info">
  99.                         <p class="d-flex align-items-center mb-1">
  100.                             Возраст:<span class="d-inline-block ml-auto">{{ profile.personParameters.age ? profile.personParameters.age : '-' }}</span>
  101.                         </p>
  102.                         <p class="d-flex align-items-center mb-1">
  103.                             Рост:<span class="d-inline-block ml-auto">{{ profile.personParameters.height ? profile.personParameters.height : '-' }}</span>
  104.                         </p>
  105.                         <p class="d-flex align-items-center mb-1">
  106.                             Вес:<span class="d-inline-block ml-auto">{{ profile.personParameters.weight ? profile.personParameters.weight : '-' }}</span>
  107.                         </p>
  108.                         <p class="d-flex align-items-center mb-1">
  109.                             Грудь:<span class="d-inline-block ml-auto">{{ profile.personParameters.breastSize ? profile.personParameters.breastSize : '-' }}</span>
  110.                         </p>
  111.                     </div>
  112.                     {%- set currencyProfile -%}{{ profile.city.countryCode|country_currency }}{%- endset -%}
  113.                     {%- set minPriceHour -%}{{ price_helpers._get_min(profile.apartmentsPricing.oneHourPrice,profile.takeOutPricing.oneHourPrice,currencyProfile) }}{%- endset -%}
  114.                     {%- set minPriceTwo -%}{{ price_helpers._get_min(profile.apartmentsPricing.twoHoursPrice,profile.takeOutPricing.twoHoursPrice,currencyProfile) }}{%- endset -%}
  115.                     {%- set minPriceNight -%}{{ price_helpers._get_min(profile.apartmentsPricing.nightPrice,profile.takeOutPricing.nightPrice,currencyProfile) }}{%- endset -%}
  116.                     {%- set hasOutPrice -%}{{- price_helpers._check_out_price(profile.takeOutPricing.oneHourPrice,profile.takeOutPricing.twoHoursPrice,profile.takeOutPricing.nightPrice) -}}{%- endset -%}
  117.                     <div class="item-info">
  118.                         <p class="d-flex align-items-center mb-1">
  119.                             Час:<span class="d-inline-block ml-auto description">{{ minPriceHour != '-' ? minPriceHour : '-' }}</span>
  120.                         </p>
  121.                         <p class="d-flex align-items-center mb-1">
  122.                             2 часа:<span class="d-inline-block ml-auto description">{{ minPriceTwo != '-' ? minPriceTwo : '-' }}</span>
  123.                         </p>
  124.                         <p class="d-flex align-items-center mb-1">
  125.                             Ночь:<span class="d-inline-block ml-auto description">{{ minPriceNight != '-' ? minPriceNight : '-' }}</span>
  126.                         </p>
  127.                         <p class="d-flex align-items-center mb-1">
  128.                             Экспресс:<span class="d-inline-block ml-auto description">{{ hasOutPrice == '1' ? 'Есть' : '-' }}</span>
  129.                         </p>
  130.                     </div>
  131.                 </div>
  132.                 <div class="profiles-item__status">
  133.                     {% if isSelfies %}
  134.                         <div class="status-item d-flex align-items-center justify-content-center" data-toggle="tooltip" data-placement="top" title="Есть селфи">
  135.                             <svg class="icon">
  136.                                 <use xlink:href="#icon-selfie-thumb"></use>
  137.                             </svg>
  138.                         </div>
  139.                     {% endif %}
  140.                     {% if isVideos %}
  141.                         <div class="status-item d-flex align-items-center justify-content-center" data-toggle="tooltip" data-placement="top" title="Есть видео">
  142.                             <svg class="icon">
  143.                                 <use xlink:href="#icon-video-thumb"></use>
  144.                             </svg>
  145.                         </div>
  146.                     {% endif %}
  147.                     {% if isComments %}
  148.                         <div class="status-item d-flex align-items-center justify-content-center" data-toggle="tooltip" data-placement="top" title="Есть комментарии">
  149.                             <svg class="icon">
  150.                                 <use xlink:href="#icon-comments-thumb"></use>
  151.                             </svg>
  152.                         </div>
  153.                     {% endif %}
  154.                 </div>
  155.             </div>
  156.         </div>
  157.     </div>
  158. {% endfor %}