templates/ProfileList/profile.html.twig line 1

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