<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* _paid_placements_right.html.twig */
class __TwigTemplate_49e4793ee8b776c8011e140fc99ff516 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_b91a4435ea3baf1e2b6bfda56133dace = $this->extensions["Sentry\\SentryBundle\\Tracing\\Twig\\TwigTracingExtension"];
$__internal_b91a4435ea3baf1e2b6bfda56133dace->enter($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "_paid_placements_right.html.twig"));
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "_paid_placements_right.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "_paid_placements_right.html.twig"));
// line 1
$context["topProfile"] = $this->extensions['App\Twig\PaidPlacementsExtension']->currentTopPlacement();
// line 2
echo "<div class=\"col-2\">
<div id=\"right_column_metric\">
<div class=\"card mb-1\">
<div class=\"card-header\">ТОП-Девушка</div>
";
// line 6
if ((isset($context["topProfile"]) || array_key_exists("topProfile", $context) ? $context["topProfile"] : (function () { throw new RuntimeError('Variable "topProfile" does not exist.', 6, $this->source); })())) {
// line 7
echo " ";
$context["photo"] = $this->extensions['App\Twig\ProfileAvatarExtension']->profileAvatar((isset($context["topProfile"]) || array_key_exists("topProfile", $context) ? $context["topProfile"] : (function () { throw new RuntimeError('Variable "topProfile" does not exist.', 7, $this->source); })()));
// line 8
echo " ";
if ((isset($context["photo"]) || array_key_exists("photo", $context) ? $context["photo"] : (function () { throw new RuntimeError('Variable "photo" does not exist.', 8, $this->source); })())) {
// line 9
echo " <img class=\"card-img-top\" src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["photo"]) || array_key_exists("photo", $context) ? $context["photo"] : (function () { throw new RuntimeError('Variable "photo" does not exist.', 9, $this->source); })()), "path", [], "any", false, false, false, 9), (((twig_get_attribute($this->env, $this->source, (isset($context["photo"]) || array_key_exists("photo", $context) ? $context["photo"] : (function () { throw new RuntimeError('Variable "photo" does not exist.', 9, $this->source); })()), "type", [], "any", false, false, false, 9) == "photo")) ? ("profile_media") : ("profile_media_avatar"))), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["topProfile"]) || array_key_exists("topProfile", $context) ? $context["topProfile"] : (function () { throw new RuntimeError('Variable "topProfile" does not exist.', 9, $this->source); })()), "name", [], "any", false, false, false, 9), "html", null, true);
echo "\">
";
}
// line 11
echo " <div class=\"card-body\">
<a href=\"";
// line 12
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("profile_preview.page", ["city" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["topProfile"]) || array_key_exists("topProfile", $context) ? $context["topProfile"] : (function () { throw new RuntimeError('Variable "topProfile" does not exist.', 12, $this->source); })()), "city", [], "any", false, false, false, 12), "uriIdentity", [], "any", false, false, false, 12), "profile" => twig_get_attribute($this->env, $this->source, (isset($context["topProfile"]) || array_key_exists("topProfile", $context) ? $context["topProfile"] : (function () { throw new RuntimeError('Variable "topProfile" does not exist.', 12, $this->source); })()), "uriIdentity", [], "any", false, false, false, 12)]), "html", null, true);
echo "\">
";
// line 13
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["topProfile"]) || array_key_exists("topProfile", $context) ? $context["topProfile"] : (function () { throw new RuntimeError('Variable "topProfile" does not exist.', 13, $this->source); })()), "name", [], "any", false, false, false, 13), "html", null, true);
echo "
</a>
</div>
";
} else {
// line 17
echo " <div class=\"card-body\">
<h5 class=\"card-title\"><a href=\"";
// line 18
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("account.profile.top_placement");
echo "\">Место свободно</a></h5>
</div>
";
}
// line 21
echo " </div>
";
// line 49
echo "
<div id=\"first_ultra_vip_placement\"></div>
";
// line 52
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable($this->extensions['App\Twig\PaidPlacementsExtension']->currentVipPlacements());
foreach ($context['_seq'] as $context["_key"] => $context["placement"]) {
// line 53
echo " ";
$context["isProfile"] = twig_get_attribute($this->env, $this->source, $context["placement"], "profile", [], "any", true, true, false, 53);
// line 54
echo " ";
$context["entity"] = (((isset($context["isProfile"]) || array_key_exists("isProfile", $context) ? $context["isProfile"] : (function () { throw new RuntimeError('Variable "isProfile" does not exist.', 54, $this->source); })())) ? (twig_get_attribute($this->env, $this->source, $context["placement"], "profile", [], "any", false, false, false, 54)) : (twig_get_attribute($this->env, $this->source, $context["placement"], "saloon", [], "any", false, false, false, 54)));
// line 55
echo " <div class=\"card mb-1\">
<div class=\"card-header sidebar-vip-metric\">VIP</div>
";
// line 57
$context["photo"] = (((isset($context["isProfile"]) || array_key_exists("isProfile", $context) ? $context["isProfile"] : (function () { throw new RuntimeError('Variable "isProfile" does not exist.', 57, $this->source); })())) ? ($this->extensions['App\Twig\ProfileAvatarExtension']->profileAvatar((isset($context["entity"]) || array_key_exists("entity", $context) ? $context["entity"] : (function () { throw new RuntimeError('Variable "entity" does not exist.', 57, $this->source); })()))) : (twig_get_attribute($this->env, $this->source, (isset($context["entity"]) || array_key_exists("entity", $context) ? $context["entity"] : (function () { throw new RuntimeError('Variable "entity" does not exist.', 57, $this->source); })()), "thumbnail", [], "any", false, false, false, 57)));
// line 58
echo " ";
if ((isset($context["photo"]) || array_key_exists("photo", $context) ? $context["photo"] : (function () { throw new RuntimeError('Variable "photo" does not exist.', 58, $this->source); })())) {
// line 59
echo " ";
if ((isset($context["isProfile"]) || array_key_exists("isProfile", $context) ? $context["isProfile"] : (function () { throw new RuntimeError('Variable "isProfile" does not exist.', 59, $this->source); })())) {
// line 60
echo " <img class=\"card-img-top\" src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["photo"]) || array_key_exists("photo", $context) ? $context["photo"] : (function () { throw new RuntimeError('Variable "photo" does not exist.', 60, $this->source); })()), "path", [], "any", false, false, false, 60), (((twig_get_attribute($this->env, $this->source, (isset($context["photo"]) || array_key_exists("photo", $context) ? $context["photo"] : (function () { throw new RuntimeError('Variable "photo" does not exist.', 60, $this->source); })()), "type", [], "any", false, false, false, 60) == "photo")) ? ("profile_media") : ("profile_media_avatar"))), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["entity"]) || array_key_exists("entity", $context) ? $context["entity"] : (function () { throw new RuntimeError('Variable "entity" does not exist.', 60, $this->source); })()), "name", [], "any", false, false, false, 60), "html", null, true);
echo "\">
";
} else {
// line 62
echo " <img class=\"card-img-top\" src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["photo"]) || array_key_exists("photo", $context) ? $context["photo"] : (function () { throw new RuntimeError('Variable "photo" does not exist.', 62, $this->source); })()), "path", [], "any", false, false, false, 62), "saloon_media_thumb"), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["entity"]) || array_key_exists("entity", $context) ? $context["entity"] : (function () { throw new RuntimeError('Variable "entity" does not exist.', 62, $this->source); })()), "name", [], "any", false, false, false, 62), "html", null, true);
echo "\">
";
}
// line 64
echo " ";
}
// line 65
echo " <div class=\"card-body\">
";
// line 66
if ((isset($context["isProfile"]) || array_key_exists("isProfile", $context) ? $context["isProfile"] : (function () { throw new RuntimeError('Variable "isProfile" does not exist.', 66, $this->source); })())) {
// line 67
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("profile_preview.page", ["city" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["entity"]) || array_key_exists("entity", $context) ? $context["entity"] : (function () { throw new RuntimeError('Variable "entity" does not exist.', 67, $this->source); })()), "city", [], "any", false, false, false, 67), "uriIdentity", [], "any", false, false, false, 67), "profile" => twig_get_attribute($this->env, $this->source, (isset($context["entity"]) || array_key_exists("entity", $context) ? $context["entity"] : (function () { throw new RuntimeError('Variable "entity" does not exist.', 67, $this->source); })()), "uriIdentity", [], "any", false, false, false, 67)]), "html", null, true);
echo "\">
";
// line 68
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["entity"]) || array_key_exists("entity", $context) ? $context["entity"] : (function () { throw new RuntimeError('Variable "entity" does not exist.', 68, $this->source); })()), "name", [], "any", false, false, false, 68), "html", null, true);
echo "
</a>
";
} else {
// line 71
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("saloon_preview.page", ["city" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["entity"]) || array_key_exists("entity", $context) ? $context["entity"] : (function () { throw new RuntimeError('Variable "entity" does not exist.', 71, $this->source); })()), "city", [], "any", false, false, false, 71), "uriIdentity", [], "any", false, false, false, 71), "saloon" => twig_get_attribute($this->env, $this->source, (isset($context["entity"]) || array_key_exists("entity", $context) ? $context["entity"] : (function () { throw new RuntimeError('Variable "entity" does not exist.', 71, $this->source); })()), "uriIdentity", [], "any", false, false, false, 71)]), "html", null, true);
echo "\">
";
// line 72
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["entity"]) || array_key_exists("entity", $context) ? $context["entity"] : (function () { throw new RuntimeError('Variable "entity" does not exist.', 72, $this->source); })()), "name", [], "any", false, false, false, 72), "html", null, true);
echo "
</a>
";
}
// line 75
echo " </div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['placement'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 78
echo "
<div id=\"rest_ultra_vip_placement\"></div>
</div>
</div>
<script src=\"";
// line 83
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("ajax.js", "js_script"), "html", null, true);
echo "\"></script>
<script src=\"";
// line 84
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("sidebar-extender.js", "js_script"), "html", null, true);
echo "\"></script>
<script>
;(function () {
document.addEventListener('DOMContentLoaded', function(){
// enlargeSidebar() - считает разницу в высоте основного контенкта и правой колонки
// !!! контейнеры колонок внутри обернул в div, по которым и считаю размер, т.к. внешние могут быть вытянуты до одинаковой высоты.
// для лейаута в 3 колонки - left_column_metric, center_column_metric, right_column_metric
// для лейаута в 2 колонки - main_column_metric, right_column_metric
// где right_column_metric - в контейнере самого сайдбара
// по принимаем параметрам SidebarExtender см. sidebar-extender.js
var sidebarEnlarger = enlargeSidebar();
function enlargeSidebar() {
var leftColumn = document.querySelector('#left_column_metric');
var centerColumn = document.querySelector('#center_column_metric');
var rightColumn = document.querySelector('#right_column_metric');
var mainColumn = document.querySelector('#main_column_metric');
var maxHeight;
if(leftColumn && centerColumn) {
maxHeight = Math.max(leftColumn.scrollHeight, centerColumn.scrollHeight);
} else if(mainColumn) {
maxHeight = mainColumn.scrollHeight;
} else {
console.log('Cannot detect content height for sidebar');
return;
}
var heightDiff = maxHeight - rightColumn.scrollHeight;
if(heightDiff <= 0)
return;
//подставить нужное
var ultraVipContainerHeight = 315; //,document.querySelector('.sidebar-ultra-vip-metric').scrollHeight,
var verticalPadding = 5; //подставить нужное
var toAdd = 0;
if (heightDiff >= verticalPadding + ultraVipContainerHeight)
toAdd = Math.floor(heightDiff / (verticalPadding + ultraVipContainerHeight));
var genders = [";
// line 124
echo twig_escape_filter($this->env, $this->extensions['App\Twig\PersonParametersExtension']->genderFemale(), "html", null, true);
echo ", ";
echo twig_escape_filter($this->env, $this->extensions['App\Twig\PersonParametersExtension']->genderMale(), "html", null, true);
echo ", ";
echo twig_escape_filter($this->env, $this->extensions['App\Twig\PersonParametersExtension']->genderTrans(), "html", null, true);
echo "];
let onlyProfile = null, onlyMasseur = null, onlySaloon = null;
";
// line 126
if (twig_in_filter("profile_list.list_by_gender", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 126, $this->source); })()), "request", [], "any", false, false, false, 126), "get", ["_route"], "method", false, false, false, 126))) {
// line 127
echo " ";
if (($this->extensions['App\Twig\PersonParametersExtension']->genderValueByUri(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 127, $this->source); })()), "request", [], "any", false, false, false, 127), "get", ["gender"], "method", false, false, false, 127)) == $this->extensions['App\Twig\PersonParametersExtension']->genderMale())) {
// line 128
echo " genders = [";
echo twig_escape_filter($this->env, $this->extensions['App\Twig\PersonParametersExtension']->genderMale(), "html", null, true);
echo "];
onlyProfile = true;
";
} elseif (($this->extensions['App\Twig\PersonParametersExtension']->genderValueByUri(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 130
(isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 130, $this->source); })()), "request", [], "any", false, false, false, 130), "get", ["gender"], "method", false, false, false, 130)) == $this->extensions['App\Twig\PersonParametersExtension']->genderTrans())) {
// line 131
echo " genders = [";
echo twig_escape_filter($this->env, $this->extensions['App\Twig\PersonParametersExtension']->genderTrans(), "html", null, true);
echo "];
onlyProfile = true;
";
}
// line 134
echo " ";
} elseif (twig_in_filter("masseur_list.page", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 134, $this->source); })()), "request", [], "any", false, false, false, 134), "get", ["_route"], "method", false, false, false, 134))) {
// line 135
echo " onlyMasseur = true;
";
} elseif (twig_in_filter("saloon_list", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 136
(isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 136, $this->source); })()), "request", [], "any", false, false, false, 136), "get", ["_route"], "method", false, false, false, 136))) {
// line 137
echo " onlySaloon = true;
";
}
// line 139
echo "
if(toAdd < 1)
toAdd = 1; //для Сани
var sidebarEnlarger = new SidebarExtender({
toAdd: toAdd,
restPlacementsContainer: document.querySelector('#rest_ultra_vip_placement'),
";
// line 147
$context["current_city"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 147, $this->source); })()), "request", [], "any", false, false, false, 147), "attributes", [], "any", false, false, false, 147), "get", ["city", $this->extensions['App\Twig\DefaultCityExtension']->defaultCity()], "method", false, false, false, 147);
// line 148
echo " ajaxUrl: '";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("api.sidebar.ultra_vip_list", ["city" => ((twig_get_attribute($this->env, $this->source, ($context["current_city"] ?? null), "uriIdentity", [], "any", true, true, false, 148)) ? (twig_get_attribute($this->env, $this->source, (isset($context["current_city"]) || array_key_exists("current_city", $context) ? $context["current_city"] : (function () { throw new RuntimeError('Variable "current_city" does not exist.', 148, $this->source); })()), "uriIdentity", [], "any", false, false, false, 148)) : ((isset($context["current_city"]) || array_key_exists("current_city", $context) ? $context["current_city"] : (function () { throw new RuntimeError('Variable "current_city" does not exist.', 148, $this->source); })()))), "imageSize" => "357x500"]), "html", null, true);
echo "',
genders: genders,
onlyProfile: onlyProfile,
onlyMasseur: onlyMasseur,
onlySaloon: onlySaloon,
exclude: [], //Array.prototype.slice.apply(document.querySelectorAll('[data-ultravipid]')).map(function(el) {return el.dataset['ultravipid'];}),
template:
'<div class=\"card mb-1 sidebar-ultra-vip-metric\">\\n' +
' <div class=\"card-header\">Ultra VIP</div>\\n' +
' <img class=\"card-img-top\" src=\"%PHOTO%\" alt=\"%NAME%\">\\n' +
' <div class=\"card-body\">\\n' +
' <a href=\"%URL%\">\\n' +
' %NAME%\\n' +
' </a>\\n' +
' %PRICE%\\n' +
' %STATION%\\n' +
' <div class=\"approved%APPROVED%\">Verified</div>\\n' +
' %PHONE%\\n' +
' </div>\\n' +
'</div>'
});
//enlarge your sidebar
sidebarEnlarger.extend();
return sidebarEnlarger;
}
});
})();
</script>";
$__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "_paid_placements_right.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 285 => 148, 283 => 147, 273 => 139, 269 => 137, 267 => 136, 264 => 135, 261 => 134, 254 => 131, 252 => 130, 246 => 128, 243 => 127, 241 => 126, 232 => 124, 189 => 84, 185 => 83, 178 => 78, 170 => 75, 164 => 72, 159 => 71, 153 => 68, 148 => 67, 146 => 66, 143 => 65, 140 => 64, 132 => 62, 124 => 60, 121 => 59, 118 => 58, 116 => 57, 112 => 55, 109 => 54, 106 => 53, 102 => 52, 97 => 49, 93 => 21, 87 => 18, 84 => 17, 77 => 13, 73 => 12, 70 => 11, 62 => 9, 59 => 8, 56 => 7, 54 => 6, 48 => 2, 46 => 1,);
}
public function getSourceContext()
{
return new Source("{% set topProfile = profile_top_placement() %}
<div class=\"col-2\">
<div id=\"right_column_metric\">
<div class=\"card mb-1\">
<div class=\"card-header\">ТОП-Девушка</div>
{% if topProfile %}
{% set photo = topProfile|avatar %}
{% if photo %}
<img class=\"card-img-top\" src=\"{{ asset(photo.path, photo.type == 'photo' ? 'profile_media' : 'profile_media_avatar') }}\" alt=\"{{ topProfile.name }}\">
{% endif %}
<div class=\"card-body\">
<a href=\"{{ path('profile_preview.page', {'city': topProfile.city.uriIdentity, 'profile': topProfile.uriIdentity}) }}\">
{{ topProfile.name }}
</a>
</div>
{% else %}
<div class=\"card-body\">
<h5 class=\"card-title\"><a href=\"{{ path('account.profile.top_placement') }}\">Место свободно</a></h5>
</div>
{% endif %}
</div>
{# {% for placement in profile_ultra_vip_placements() %}
{% set isProfile = attribute(placement, 'profile') is defined %}
{% set entity = isProfile ? placement.profile : placement.saloon %}
<div class=\"card mb-1 sidebar-ultra-vip-metric\" data-ultravipid=\"{{ placement.id }}\">
<div class=\"card-header\">{{placement_name_ultra_vip()}}</div>
{% set photo = isProfile ? entity|avatar : entity.thumbnail %}
{% if photo %}
{% if isProfile %}
<img class=\"card-img-top\" src=\"{{ asset(photo.path, photo.type == 'photo' ? 'profile_media' : 'profile_media_avatar') }}\" alt=\"{{ entity.name }}\">
{% else %}
<img class=\"card-img-top\" src=\"{{ asset(photo.path, 'saloon_media_thumb') }}\" alt=\"{{ entity.name }}\">
{% endif %}
{% endif %}
<div class=\"card-body\">
{% if isProfile %}
<a href=\"{{ path('profile_preview.page', {'city': entity.city.uriIdentity, 'profile': entity.uriIdentity}) }}\">
{{ entity.name }}
</a>
{% else %}
<a href=\"{{ path('saloon_preview.page', {'city': entity.city.uriIdentity, 'saloon': entity.uriIdentity}) }}\">
{{ entity.name }}
</a>
{% endif %}
</div>
</div>
{% endfor %}#}
<div id=\"first_ultra_vip_placement\"></div>
{% for placement in profile_vip_placements() %}
{% set isProfile = attribute(placement, 'profile') is defined %}
{% set entity = isProfile ? placement.profile : placement.saloon %}
<div class=\"card mb-1\">
<div class=\"card-header sidebar-vip-metric\">VIP</div>
{% set photo = isProfile ? entity|avatar : entity.thumbnail %}
{% if photo %}
{% if isProfile %}
<img class=\"card-img-top\" src=\"{{ asset(photo.path, photo.type == 'photo' ? 'profile_media' : 'profile_media_avatar') }}\" alt=\"{{ entity.name }}\">
{% else %}
<img class=\"card-img-top\" src=\"{{ asset(photo.path, 'saloon_media_thumb') }}\" alt=\"{{ entity.name }}\">
{% endif %}
{% endif %}
<div class=\"card-body\">
{% if isProfile %}
<a href=\"{{ path('profile_preview.page', {'city': entity.city.uriIdentity, 'profile': entity.uriIdentity}) }}\">
{{ entity.name }}
</a>
{% else %}
<a href=\"{{ path('saloon_preview.page', {'city': entity.city.uriIdentity, 'saloon': entity.uriIdentity}) }}\">
{{ entity.name }}
</a>
{% endif %}
</div>
</div>
{% endfor %}
<div id=\"rest_ultra_vip_placement\"></div>
</div>
</div>
<script src=\"{{ asset('ajax.js', 'js_script') }}\"></script>
<script src=\"{{ asset('sidebar-extender.js', 'js_script') }}\"></script>
<script>
;(function () {
document.addEventListener('DOMContentLoaded', function(){
// enlargeSidebar() - считает разницу в высоте основного контенкта и правой колонки
// !!! контейнеры колонок внутри обернул в div, по которым и считаю размер, т.к. внешние могут быть вытянуты до одинаковой высоты.
// для лейаута в 3 колонки - left_column_metric, center_column_metric, right_column_metric
// для лейаута в 2 колонки - main_column_metric, right_column_metric
// где right_column_metric - в контейнере самого сайдбара
// по принимаем параметрам SidebarExtender см. sidebar-extender.js
var sidebarEnlarger = enlargeSidebar();
function enlargeSidebar() {
var leftColumn = document.querySelector('#left_column_metric');
var centerColumn = document.querySelector('#center_column_metric');
var rightColumn = document.querySelector('#right_column_metric');
var mainColumn = document.querySelector('#main_column_metric');
var maxHeight;
if(leftColumn && centerColumn) {
maxHeight = Math.max(leftColumn.scrollHeight, centerColumn.scrollHeight);
} else if(mainColumn) {
maxHeight = mainColumn.scrollHeight;
} else {
console.log('Cannot detect content height for sidebar');
return;
}
var heightDiff = maxHeight - rightColumn.scrollHeight;
if(heightDiff <= 0)
return;
//подставить нужное
var ultraVipContainerHeight = 315; //,document.querySelector('.sidebar-ultra-vip-metric').scrollHeight,
var verticalPadding = 5; //подставить нужное
var toAdd = 0;
if (heightDiff >= verticalPadding + ultraVipContainerHeight)
toAdd = Math.floor(heightDiff / (verticalPadding + ultraVipContainerHeight));
var genders = [{{ gender_female() }}, {{ gender_male() }}, {{ gender_trans() }}];
let onlyProfile = null, onlyMasseur = null, onlySaloon = null;
{% if 'profile_list.list_by_gender' in app.request.get('_route') %}
{% if app.request.get('gender')|gender_value_by_uri == gender_male() %}
genders = [{{ gender_male() }}];
onlyProfile = true;
{% elseif app.request.get('gender')|gender_value_by_uri == gender_trans() %}
genders = [{{ gender_trans() }}];
onlyProfile = true;
{% endif %}
{% elseif 'masseur_list.page' in app.request.get('_route') %}
onlyMasseur = true;
{% elseif 'saloon_list' in app.request.get('_route') %}
onlySaloon = true;
{% endif %}
if(toAdd < 1)
toAdd = 1; //для Сани
var sidebarEnlarger = new SidebarExtender({
toAdd: toAdd,
restPlacementsContainer: document.querySelector('#rest_ultra_vip_placement'),
{% set current_city = app.request.attributes.get('city', default_city()) %}
ajaxUrl: '{{ path('api.sidebar.ultra_vip_list', {city:current_city.uriIdentity is defined ? current_city.uriIdentity : current_city, imageSize: '357x500'}) }}',
genders: genders,
onlyProfile: onlyProfile,
onlyMasseur: onlyMasseur,
onlySaloon: onlySaloon,
exclude: [], //Array.prototype.slice.apply(document.querySelectorAll('[data-ultravipid]')).map(function(el) {return el.dataset['ultravipid'];}),
template:
'<div class=\"card mb-1 sidebar-ultra-vip-metric\">\\n' +
' <div class=\"card-header\">Ultra VIP</div>\\n' +
' <img class=\"card-img-top\" src=\"%PHOTO%\" alt=\"%NAME%\">\\n' +
' <div class=\"card-body\">\\n' +
' <a href=\"%URL%\">\\n' +
' %NAME%\\n' +
' </a>\\n' +
' %PRICE%\\n' +
' %STATION%\\n' +
' <div class=\"approved%APPROVED%\">Verified</div>\\n' +
' %PHONE%\\n' +
' </div>\\n' +
'</div>'
});
//enlarge your sidebar
sidebarEnlarger.extend();
return sidebarEnlarger;
}
});
})();
</script>", "_paid_placements_right.html.twig", "/app/templates/_paid_placements_right.html.twig");
}
}