templates/ProfileList/profile.html.twig line 1

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