templates/ProfilePreview/page.html.twig line 1

Open in your IDE?
  1. {% extends 'ProfilePreview/grid.html.twig' %}
  2. {% set soft_deleted_410 = feature('410_soft_delete') and profile.deleted %}
  3. {% block title %}
  4.     {% if soft_deleted_410 %}
  5.         Анкета {{ profile.name|trans }}, ID {{ profile.id }} снята с публикации - | Похожие предложения.
  6.     {% else %}
  7.         {{ seo_title() }}
  8.     {% endif %}
  9. {% endblock %}
  10. {% block metaDescription %}
  11.     {% if soft_deleted_410 %}
  12.         <meta name="description" content="{{ profile.name|trans }}, ID {{ profile.id }} сейчас не работает и недоступна в результатах поиска. Взгляните на похожие анкеты, которые мы подобрали специально для Вас.">
  13.     {% else %}
  14.         <meta name="description" content="{{ seo_description() }}">
  15.     {% endif %}
  16. {% endblock %}
  17. {% block canonical %}
  18.     {% if soft_deleted_410 %}
  19.         <link rel="canonical" href="{{ city_profiles_canonical_url(profile.city, actual_main_domain) }}">
  20.     {% else %}
  21.         {{ parent() }}
  22.     {% endif %}
  23. {% endblock %}
  24. {% block navbar %}
  25.     {{ parent() }}
  26.     {% if not soft_deleted_410 %}
  27.         {% set excludeRecommendationProfileIds = [profile.id] %}
  28.         {% include 'Recommendations/_profile_recommendations.html.twig' %}
  29.     {% endif %}
  30. {% endblock %}
  31. {% block mainContainer %}
  32.     <div class="row" alt="{{ profile.seo ? profile.seo.phone : '' }}">
  33.         <div class="col-3">
  34.             <div id="left_column_metric">
  35.                 {% if not app.user or is_user_customer(app.user) %}
  36.                     <div><a class="add-remove-favourite" data-action="remove" href="javascript:void(0);"
  37.                             style="display: {{ is_profile_in_favourites(profile) ? 'block' : 'none' }}">UNLIKE</a></div>
  38.                     <div><a class="add-remove-favourite" data-action="add"
  39.                             style="display: {{ not is_profile_in_favourites(profile) ? 'block' : 'none' }}"
  40.                             {% if app.user %}href="javascript:void(0);"
  41.                             {% else %}href="javascript:alert('Чтобы сделать что-то зарегистрируйтесь');"{% endif %}>LIKE</a>
  42.                     </div>
  43.                 {% endif %}
  44.                 <div class="row">
  45.                     {% if profile.isApproved %} <b style="color:green;">APPROVED</b><br/> {% endif %}
  46.                     {% if not profile.deleted %}
  47.                         {% if profile.isModerationRejected %}
  48.                             <img src="{{ asset('static/img/red-circle.png') }}"
  49.                                  alt="{{ profile.seo ? profile.seo.phone : '' }}" width="150">
  50.                         {% else %}
  51.                             {% set photo = profile|avatar %}
  52.                             {% if photo %}
  53.                                 <img src="{{ asset(photo.path, photo.type == 'photo' ? 'profile_media' : 'profile_media_avatar') }}"
  54.                                      alt="{{ profile.seo ? profile.seo.phone : '' }}" width="150">
  55.                             {% endif %}
  56.                         {% endif %}
  57.                     {% else %}
  58.                         Фото-заглушка
  59.                     {% endif %}
  60.                 </div>
  61.                 {% if false == profile.isModerationRejected and profile.photos|length > 0 %}
  62.                     <div class="row">
  63.                         {% if not profile.deleted %}
  64.                             {% for photo in profile.photos %}
  65.                                 <div class="col-4">
  66.                                     <img src="{{ asset(photo.path, 'profile_media') }}" alt="" width="150">
  67.                                 </div>
  68.                             {% endfor %}
  69.                         {% endif %}
  70.                     </div>
  71.                 {% endif %}
  72.                 {% if false == profile.isModerationRejected and profile.selfies|length > 0 %}
  73.                     <div class="row">
  74.                         {% if not profile.deleted %}
  75.                             {% for photo in profile.selfies %}
  76.                                 {% if photo.main == false %}
  77.                                     <div class="col-4">
  78.                                         <img src="{{ asset(photo.path, 'profile_media_selfie') }}" alt="" width="150">
  79.                                     </div>
  80.                                 {% endif %}
  81.                             {% endfor %}
  82.                         {% endif %}
  83.                     </div>
  84.                 {% endif %}
  85.                 {% if false == profile.isModerationRejected and not profile.deleted %}
  86.                     <div class="row">
  87.                         {% for video in profile.confirmedVideos | filter(video => video.previewPath) %}
  88.                             <div class="col-4">
  89.                                 <video width="100%" controls
  90.                                        poster="{{ asset(video.previewPath, 'profile_media', 'fullsize') }}">
  91.                                     <source src="{{ asset(video.path, 'profile_media', 'fullsize') }}" type="video/mp4">
  92.                                     Your browser does not support the video tag.
  93.                                 </video>
  94.                             </div>
  95.                         {% endfor %}
  96.                     </div>
  97.                 {% endif %}
  98.             </div>
  99.         </div>
  100.         <div class="col-9">
  101.             <div id="center_column_metric">
  102.                 <h5>{{ profile.name|trans }} {{ rating }}&#9733;
  103.                     {% if not profile.deleted %}
  104.                         {% if profile.isModerationRejected %}
  105.                             <h3>Анкета отклонена модератором</h3>
  106.                         {% else %}
  107.                             {% if profile.active %}
  108.                                 <small><a href="tel:{{ profile.phoneNumber }}">{{ profile.phoneNumber }}</a></small>
  109.                             {% endif %}
  110.                         {% endif %}
  111.                     {% else %}
  112.                         Заглушка телефона
  113.                     {% endif %}
  114.                 </h5>
  115.                 <dl>
  116.                     <dt>{% trans %}Город{% endtrans %}</dt>
  117.                     <dd>{{ profile.city.name|trans }}</dd>
  118.                     <dt>{% trans %}Метро{% endtrans %}</dt>
  119.                     <dd>
  120.                         {% for station in profile.stationsSortedByPrimary %}
  121.                             <a href="{{ path('profile_list.list_by_station', {'city': profile.city.uriIdentity, 'station': station.uriIdentity}) }}">{{ station.name|trans }} {% if loop.first %}*{% endif %}</a>
  122.                             {% if not loop.last %}, {% endif %}
  123.                         {% endfor %}
  124.                     </dd>
  125.                     <dt>{% trans %}Район{% endtrans %}</dt>
  126.                     <dd>
  127.                         {% for station in profile.stationsSortedByPrimary %}
  128.                             {% set stationDistrict = station.district %}
  129.                             {% if stationDistrict %}
  130.                                 {% set districtCounty = stationDistrict.county %}
  131.                                 {% if districtCounty %}
  132.                                     <a href="{{ path('profile_list.list_by_county', {'city': profile.city.uriIdentity, 'county': districtCounty.uriIdentity}) }}">{{ districtCounty.name|trans }}</a>
  133.                                 {% endif %}
  134.                             {% endif %}
  135.                         {% endfor %}
  136.                     </dd>
  137.                     {% if not profile.deleted %}
  138.                         {% if not profile.isModerationRejected %}
  139.                             <dt><strong>{% trans %}Телефон{% endtrans %}</strong></dt>
  140.                             <dd><strong>{{ profile.phoneNumber }}</strong></dd>
  141.                             {% if feature('extended_profile_form')
  142.                                 and profile.messengers
  143.                                 and profile.messengers.hasTelegram
  144.                                 and profile.messengers.telegramUsername is not empty %}
  145.                                 <dt>
  146.                                     <strong>{% trans %}Телеграм{% endtrans %}</strong> {{ profile.messengers.hasTelegram }}
  147.                                 </dt>
  148.                                 <dd><a href="https://t.me/{{ profile.messengers.telegramUsername }}"
  149.                                        target="_blank" rel="nofollow noopener">
  150.                                         @{{ profile.messengers.telegramUsername }}
  151.                                     </a></dd>
  152.                             {% endif %}
  153.                         {% endif %}
  154.                     {% else %}
  155.                         Заглушка телефона
  156.                     {% endif %}
  157.                     {% if feature('extra_category_without_prepayment') %}
  158.                         {% if profile.prepayment %}
  159.                             <dt>Оплата</dt>
  160.                             <dd>
  161.                                 Предоплата {{ profile.prepaymentAmount }}{% if profile.prepaymentComment %}. {{ profile.prepaymentComment }}{% endif %}
  162.                             </dd>
  163.                         {% elseif profile.prepayment is same as(false) %}
  164.                             <dt>Оплата</dt>
  165.                             <dd>Без предоплаты</dd>
  166.                         {% endif %}
  167.                     {% endif %}
  168.                     <dt>{% trans %}Возраст{% endtrans %}</dt>
  169.                     <dd>{{ profile.personParameters.age }}</dd>
  170.                     <dt>{% trans %}Рост{% endtrans %}</dt>
  171.                     <dd>{{ profile.personParameters.height }}</dd>
  172.                     <dt>{% trans %}Размер груди{% endtrans %}</dt>
  173.                     <dd>{{ profile.personParameters.breastSize }}</dd>
  174.                     <dt>{% trans %}Вес{% endtrans %}</dt>
  175.                     <dd>{{ profile.personParameters.weight }}</dd>
  176.                     <dt>{% trans %}Размер одежды{% endtrans %}</dt>
  177.                     <dd>{{ profile.personParameters.clothSize }}</dd>
  178.                     <dt>{% trans %}Телосложение{% endtrans %}</dt>
  179.                     <dd>{{ profile.personParameters.bodyType|body_type|trans }}</dd>
  180.                     <dt>{% trans %}Цвет волос{% endtrans %}</dt>
  181.                     <dd>{{ profile.personParameters.hairColor|hair_color|trans }}</dd>
  182.                     <dt>{% trans %}Интимная стрижка{% endtrans %}</dt>
  183.                     <dd>{{ profile.personParameters.privateHaircut|private_haircut|trans }}</dd>
  184.                     <dt>{% trans %}Национальность{% endtrans %}</dt>
  185.                     <dd>{{ profile.personParameters.nationality|nationality|trans }}</dd>
  186.                     <dt>{% trans %}Дата обновления{% endtrans %}</dt>
  187.                     <dd>{{ profile.updatedAt|date }}</dd>
  188.                 </dl>
  189.                 <h6>{% trans %}О себе{% endtrans %}</h6>
  190.                 <p>{{ profile.description|trans }}</p>
  191.                 <h6>{% trans %}Предпочтения{% endtrans %}</h6>
  192.                 {% for group, servicesGroup in services | filter((servicesGroup, group) => not profile.masseur or group not in masseurExcludeServiceGroups) %}
  193.                     <p><strong>{{ group|service_group|trans({}, 'service_groups') }}</strong></p>
  194.                     <ul>
  195.                         {% for service in servicesGroup %}
  196.                             {% set providedService = profile.providedService(service) %}
  197.                             <li class="{% if providedService %}text-success{% else %}text-danger{% endif %}">
  198.                                 <a href="{{ path('profile_list.list_by_provided_service', {'city': profile.city.uriIdentity, 'service': service.uriIdentity}) }}">{{ service.name|trans }}</a>
  199.                             </li>
  200.                             {% if providedService %}
  201.                                 {% if feature('extended_profile_form') %}
  202.                                     {{ providedService.condition|provided_service_condition|trans({},'service_conditions') }}{% if providedService.condition == 3 %}, цена:{{ providedService.extraCharge }}{% endif %}
  203.                                 {% endif %}
  204.                                 {% if providedService.comment %}
  205.                                     Комментарий: {{ providedService.comment }}
  206.                                 {% endif %}
  207.                             {% endif %}
  208.                         {% endfor %}
  209.                     </ul>
  210.                 {% endfor %}
  211.                 <h6>{% trans %}Отзывы{% endtrans %}</h6>
  212.                 <div id="comments">
  213.                     {% for comment in profile.comments %}
  214.                         {% include 'ProfilePreview/comment.html.twig' %}
  215.                     {% else %}
  216.                         <p>{% trans %}Отзывов нет{% endtrans %}</p>
  217.                     {% endfor %}
  218.                 </div>
  219.                 <div id="commentFormContainer">
  220.                 </div>
  221.                 <div id="recaptcha-container"></div>
  222.                 {% if feature('extended_profile_form') %}
  223.                     <div>
  224.                         {% if profile.expressPricing %}
  225.                             <b>Экспресс:</b>
  226.                             {% if profile.expressPricing.provided %}
  227.                                 Да, стоимость{{ profile.expressPricing.price }}
  228.                             {% else %}
  229.                                 Нет
  230.                             {% endif %}
  231.                         {% endif %}
  232.                     </div>
  233.                 {% endif %}
  234.                 {% if profile.clientTypes %}
  235.                     <div>
  236.                         <b>Услуги для:</b>
  237.                         {% for clientType in profile.clientTypes %}
  238.                             {{ clientType|client_type|trans({}, 'client_types') }}<br>
  239.                         {% endfor %}
  240.                     </div>
  241.                 {% endif %}
  242.                 {% if feature('extended_profile_form') %}
  243.                     <div>
  244.                         {% if profile.messengers %}
  245.                             <b>Мессенджеры</b><br>
  246.                             <b>Telegram</b> {{ profile.messengers.telegram ? 'Да' : 'Нет' }}
  247.                             <b>WhatsApp</b> {{ profile.messengers.whatsApp ? 'Да' : 'Нет' }}
  248.                         {% endif %}
  249.                     </div>
  250.                 {% endif %}
  251.                 {% if feature('extended_profile_form') %}
  252.                     <div>
  253.                         {% if profile.carPricing %}
  254.                             <b>В машине:</b> {{ profile.carPricing.provided ? 'Да' : 'Нет' }}
  255.                         {% endif %}
  256.                     </div>
  257.                 {% endif %}
  258.                 {% if feature('extended_profile_form') %}
  259.                     <div>
  260.                         {% if profile.personParameters.tattoo is not null %}
  261.                             <b>Тату:</b> {{ profile.personParameters.tattoo ? 'Да' : 'Нет' }}
  262.                         {% endif %}
  263.                     </div>
  264.                     <div>
  265.                         {% if profile.personParameters.piercing is not null %}
  266.                             <b>Пирсинг:</b> {{ profile.personParameters.piercing ? 'Да' : 'Нет' }}
  267.                         {% endif %}
  268.                     </div>
  269.                 {% endif %}
  270.                 <div>
  271.                     <b>Отвечаю на:</b>
  272.                     {% for answeringTo in profile.phoneCallRestrictions.answeringTo %}
  273.                         {{ answeringTo|answering_to|trans({}, 'phone_call_restrictions') }}<br>
  274.                     {% endfor %}
  275.                 </div>
  276.             </div>
  277.         </div>
  278.         {% if soft_deleted_410 %}
  279.             <div class="col-12">
  280.                 <div class="alert alert-secondary">
  281.                     <strong>Анкета снята с публикации</strong><br>
  282.                     Анкета сейчас не работает и недоступна в результатах поиска.
  283.                 </div>
  284.                 {% include 'ProfilePreview/nearest_profiles.html.twig' with {'title': 'Проститутки рядом'} %}
  285.                 <h2>Рекомендации для вас</h2>
  286.                 {% set excludeRecommendationProfileIds = [profile.id] %}
  287.                 {% include 'Recommendations/_profile_recommendations.html.twig' %}
  288.             </div>
  289.         {% else %}
  290.             {% include 'ProfilePreview/nearest_profiles.html.twig' %}
  291.         {% endif %}
  292.         <div id="recentlyViewedProfiles"></div>
  293.     </div>
  294.     <script type="text/javascript">
  295.         var onloadCallback = function () {
  296.             grecaptcha.render('recaptcha-container', {
  297.                 'sitekey': '{{ ewz_recaptcha_site_key }}'
  298.             });
  299.         };
  300.     </script>
  301.     <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
  302.     <script src="{{ asset('ajax.js', 'js_script') }}"></script>
  303.     <script src="{{ asset('local-storage.js', 'js_script') }}"></script>
  304.     <script src="{{ asset('recommendations.js', 'js_script') }}"></script>
  305.     <script src="{{ asset('bot-helper.js', 'js_script') }}"></script>
  306.     <script src="{{ asset('recently-viewed.js', 'js_script') }}"></script>
  307.     <script type="text/javascript">
  308.         document.addEventListener('DOMContentLoaded', function () {
  309.             ajax({
  310.                 url: '{{ path('profile_ctr.increase_views') }}',
  311.                 data: {
  312.                     profile: {{ profile.id }},
  313.                 },
  314.                 callback: function () {},
  315.                 dataType: 'json',
  316.                 responseType: 'json',
  317.             });
  318.             profileRecommendations.addViewedProfile({{ profile.id }});
  319.             profileBotHelper.addViewedProfile({{ profile.id }});
  320.             //достаем список, пока без учета текущей страницы, для текущего аякс запроса
  321.             const recentlyViewedProfiles = recentlyViewed.getViewedProfiles();
  322.             recentlyViewed.addViewedProfile({{ profile.id }});
  323.             //recently viewed profiles
  324.             ajax({
  325.                 url: '{{ path('recent_profiles.recently_viewed.list') }}',
  326.                 data: {
  327.                     recently_viewed_profiles: recentlyViewedProfiles,
  328.                 },
  329.                 callback: function (response) {
  330.                     if (!response)
  331.                         return;
  332.                     // console.log(response);
  333.                     document.querySelector('#recentlyViewedProfiles').innerHTML = response;
  334.                 },
  335.                 dataType: 'json',
  336.                 responseType: 'text/html',
  337.             });
  338.             ajax({
  339.                 url: '{{ path('profile.comment.comment_form', {profile: profile.id}) }}',
  340.                 callback: function (response) {
  341.                     // console.log(response);
  342.                     if ('' !== response) {
  343.                         document.querySelector('#commentFormContainer').innerHTML = response;
  344.                         setCommentFormListeners();
  345.                     }
  346.                 },
  347.                 dataType: 'json',
  348.                 responseType: 'text/html',
  349.             });
  350.             function setCommentFormListeners() {
  351.                 const formName = 'comment_form';
  352.                 document.querySelector('#send_comment').addEventListener('click', function () {
  353.                     ajax({
  354.                         url: '{{ path('profile.comment.create', {profile: profile.id}) }}',
  355.                         method: '',
  356.                         data: {
  357.                             'g-recaptcha-response': grecaptcha.getResponse(),
  358.                             'entity_id': document.querySelector(`#${formName}_entity_id`).value,
  359.                             'mark': document.querySelector(`input[name="${formName}[mark]"]:checked`).value,
  360.                             'text': document.querySelector(`#${formName}_text`).value,
  361.                         },
  362.                         callback: function (response) {
  363.                             if (response) {
  364.                                 if (response.success) {
  365.                                     //document.querySelector(`#{formName}`).style.display = 'none';
  366.                                     //document.querySelector('#send_comment').style.display = 'none';
  367.                                     document.querySelector(`form[name="${formName}"]`).reset();
  368.                                     grecaptcha.reset();
  369.                                     let template =
  370.                                         '<div>' +
  371.                                         (response.comment.nickname ?
  372.                                             '<span class="author">' +
  373.                                             '<img src="#avatar" alt="shift" width="25">' +
  374.                                             '<span class="name">#nickname</span>' +
  375.                                             '</span>' : '') +
  376.                                         '<span class="date">#createdAt</span>' +
  377.                                         '<span>#text</span>' +
  378.                                         '</div>'
  379.                                     ;
  380.                                     response.comment.createdAt = new Date(response.comment.createdAt * 1000);
  381.                                     for (let k in response.comment) {
  382.                                         template = template.replace('#' + k, response.comment[k]);
  383.                                     }
  384.                                     document.querySelector('#comments').innerHTML += template;
  385.                                     // console.log(template);
  386.                                     // document.querySelector('#comments').innerHTML += response.html;
  387.                                 } else {
  388.                                     alert(response.error);
  389.                                 }
  390.                             }
  391.                         },
  392.                         dataType: 'json',
  393.                         responseType: 'json',
  394.                     });
  395.                 });
  396.             }
  397.             //LIKE/UNLIKE
  398.             document.querySelector('#left_column_metric').addEventListener('click', function (e) {
  399.                 if (false == e.target.classList.contains('add-remove-favourite'))
  400.                     return;
  401.                 addRemoveFavourite(e.target.dataset['action'] == 'add');
  402.             });
  403.             let addRemoveFavourite = function (add) {
  404.                 let btn = document.querySelector('.add-remove-favourite[data-action="' + (add ? 'add' : 'remove') + '"]');
  405.                 let reverseBtn = document.querySelector('.add-remove-favourite[data-action="' + (!add ? 'add' : 'remove') + '"]');
  406.                 btn.style.display = 'none';
  407.                 ajax({
  408.                     url: add ? '{{ path('account.favourites.add', {profile: profile.id}) }}' : '{{ path('account.favourites.remove', {profile: profile.id}) }}',
  409.                     callback: function (response) {
  410.                         if (response) {
  411.                             if (response.success) {
  412.                                 reverseBtn.style.display = 'block';
  413.                             } else {
  414.                                 btn.style.display = 'block';
  415.                                 alert(response.error);
  416.                             }
  417.                         }
  418.                     },
  419.                     dataType: 'json',
  420.                     responseType: 'json',
  421.                 });
  422.             };
  423.             //LIKE/UNLIKE end
  424.         });
  425.     </script>
  426. {% endblock %}