templates/ProfilePreview/page.html.twig line 1

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