<?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;
/* _component/header.html.twig */
class __TwigTemplate_4712ba536b29675292b218c8e5d75063 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", "_component/header.html.twig"));
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "_component/header.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "_component/header.html.twig"));
// line 1
$context["currentCity"] = 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.', 1, $this->source); })()), "request", [], "any", false, false, false, 1), "attributes", [], "any", false, false, false, 1), "get", ["city", $this->extensions['App\Twig\DefaultCityExtension']->defaultCity()], "method", false, false, false, 1);
// line 2
$context["currentStation"] = 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.', 2, $this->source); })()), "request", [], "any", false, false, false, 2), "attributes", [], "any", false, false, false, 2), "get", ["station"], "method", false, false, false, 2);
// line 3
echo "
<nav class=\"navbar navbar-expand-lg navbar-light bg-light\">
<div class=\"container\">
<a class=\"navbar-brand\" href=\"";
// line 6
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("homepage");
echo "\">Belochki</a>
<button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarSupportedContent\" aria-controls=\"navbarSupportedContent\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">
<span class=\"navbar-toggler-icon\"></span>
</button>
<div class=\"collapse navbar-collapse\" id=\"navbarSupportedContent\">
<ul class=\"navbar-nav mr-auto\">
<li class=\"nav-item\">
<a class=\"nav-link\" href=\"#\" data-toggle=\"modal\" data-target=\"#city-list\">";
// line 14
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(twig_get_attribute($this->env, $this->source, (isset($context["currentCity"]) || array_key_exists("currentCity", $context) ? $context["currentCity"] : (function () { throw new RuntimeError('Variable "currentCity" does not exist.', 14, $this->source); })()), "name", [], "any", false, false, false, 14)), "html", null, true);
echo "</a>
</li>
";
// line 16
if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["currentCity"]) || array_key_exists("currentCity", $context) ? $context["currentCity"] : (function () { throw new RuntimeError('Variable "currentCity" does not exist.', 16, $this->source); })()), "stations", [], "any", false, false, false, 16)) > 0)) {
// line 17
echo " <li class=\"nav-item\">
<a href=\"#\" class=\"nav-link\" data-toggle=\"modal\" data-target=\"#city-stations\">";
// line 18
if ((isset($context["currentStation"]) || array_key_exists("currentStation", $context) ? $context["currentStation"] : (function () { throw new RuntimeError('Variable "currentStation" does not exist.', 18, $this->source); })())) {
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(twig_get_attribute($this->env, $this->source, (isset($context["currentStation"]) || array_key_exists("currentStation", $context) ? $context["currentStation"] : (function () { throw new RuntimeError('Variable "currentStation" does not exist.', 18, $this->source); })()), "name", [], "any", false, false, false, 18)), "html", null, true);
} else {
echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Выбрать метро", [], "messages");
}
echo "</a>
</li>
";
}
// line 21
echo " ";
$context["search_by_keys_form"] = $this->extensions['App\Twig\SearchByKeywordsExtension']->getSearchByKeywordsFormView();
// line 22
echo " ";
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["search_by_keys_form"]) || array_key_exists("search_by_keys_form", $context) ? $context["search_by_keys_form"] : (function () { throw new RuntimeError('Variable "search_by_keys_form" does not exist.', 22, $this->source); })()), 'form');
echo "
";
// line 31
echo " <li class=\"nav-item\">
<a class=\"nav-link\" href=\"";
// line 32
echo twig_escape_filter($this->env, $this->extensions['App\Twig\RoutingExtension']->toggleUrlLocale("ru"), "html", null, true);
echo "\">RU</a>
</li>
<li class=\"nav-item\">
<a class=\"nav-link\" href=\"";
// line 35
echo twig_escape_filter($this->env, $this->extensions['App\Twig\RoutingExtension']->toggleUrlLocale("en"), "html", null, true);
echo "\">EN</a>
</li>
</ul>
<ul class=\"navbar-nav\">
";
// line 39
if (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.', 39, $this->source); })()), "user", [], "any", false, false, false, 39)) {
// line 40
echo " <li class=\"nav-item\"><a href=\"";
echo (($this->extensions['App\Twig\UserExtension']->isUserAdvertiser(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.', 40, $this->source); })()), "user", [], "any", false, false, false, 40))) ? ($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("account")) : ($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("account.favourites.profiles")));
echo "\" class=\"nav-link\">Личный кабинет</a></li>
<li class=\"nav-item\"><a href=\"";
// line 41
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("logout");
echo "\" class=\"nav-link\">Выход</a></li>
";
} else {
// line 43
echo " <li class=\"nav-item\"><a href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("register", ["city" => twig_get_attribute($this->env, $this->source, (isset($context["currentCity"]) || array_key_exists("currentCity", $context) ? $context["currentCity"] : (function () { throw new RuntimeError('Variable "currentCity" does not exist.', 43, $this->source); })()), "uriIdentity", [], "any", false, false, false, 43)]), "html", null, true);
echo "\" class=\"nav-link\">Регистрация</a></li>
";
// line 45
echo " <li class=\"nav-item\"><a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("login");
echo "\" class=\"nav-link\">Вход</a></li>
";
}
// line 47
echo " </ul>
</div>
</div>
</nav>
";
// line 52
echo $this->extensions['Knp\Menu\Twig\MenuExtension']->render("navbar", ["template" => "_menu/navbar.html.twig"]);
echo "
";
// line 56
echo "
";
// line 57
$context["avatar"] = $this->extensions['App\Twig\UserExtension']->getUserAvatar();
// line 58
if ((isset($context["avatar"]) || array_key_exists("avatar", $context) ? $context["avatar"] : (function () { throw new RuntimeError('Variable "avatar" does not exist.', 58, $this->source); })())) {
// line 59
echo " <img src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["avatar"]) || array_key_exists("avatar", $context) ? $context["avatar"] : (function () { throw new RuntimeError('Variable "avatar" does not exist.', 59, $this->source); })()), "path", [], "any", false, false, false, 59), "user_media"), "html", null, true);
echo "\" width=\"150\" />
";
}
// line 61
if (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.', 61, $this->source); })()), "user", [], "any", false, false, false, 61)) {
// line 62
echo " <p><strong>Баланс:</strong> ";
echo twig_escape_filter($this->env, $this->extensions['App\Twig\MoneyFormatterExtension']->formatMoney(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.', 62, $this->source); })()), "user", [], "any", false, false, false, 62), "currentBalance", [], "any", false, false, false, 62)), "html", null, true);
echo "</p>
<p><strong>Расход:</strong> ";
// line 63
echo twig_escape_filter($this->env, $this->extensions['App\Twig\MoneyFormatterExtension']->formatMoney($this->extensions['App\Twig\AccountExtension']->ownerCharges()), "html", null, true);
echo "/час</p>
";
}
// line 65
echo "
";
// line 66
echo $this->extensions['Knp\Menu\Twig\MenuExtension']->render("account_left", ["template" => "_menu/account_left.html.twig"]);
echo "
";
$__internal_b91a4435ea3baf1e2b6bfda56133dace->leave($__internal_b91a4435ea3baf1e2b6bfda56133dace_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "_component/header.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 173 => 66, 170 => 65, 165 => 63, 160 => 62, 158 => 61, 152 => 59, 150 => 58, 148 => 57, 145 => 56, 140 => 52, 133 => 47, 127 => 45, 122 => 43, 117 => 41, 112 => 40, 110 => 39, 103 => 35, 97 => 32, 94 => 31, 89 => 22, 86 => 21, 76 => 18, 73 => 17, 71 => 16, 66 => 14, 55 => 6, 50 => 3, 48 => 2, 46 => 1,);
}
public function getSourceContext()
{
return new Source("{% set currentCity = app.request.attributes.get('city', default_city()) %}
{% set currentStation = app.request.attributes.get('station') %}
<nav class=\"navbar navbar-expand-lg navbar-light bg-light\">
<div class=\"container\">
<a class=\"navbar-brand\" href=\"{{ path('homepage') }}\">Belochki</a>
<button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarSupportedContent\" aria-controls=\"navbarSupportedContent\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">
<span class=\"navbar-toggler-icon\"></span>
</button>
<div class=\"collapse navbar-collapse\" id=\"navbarSupportedContent\">
<ul class=\"navbar-nav mr-auto\">
<li class=\"nav-item\">
<a class=\"nav-link\" href=\"#\" data-toggle=\"modal\" data-target=\"#city-list\">{{ currentCity.name|trans }}</a>
</li>
{% if currentCity.stations|length > 0 %}
<li class=\"nav-item\">
<a href=\"#\" class=\"nav-link\" data-toggle=\"modal\" data-target=\"#city-stations\">{% if currentStation %}{{ currentStation.name|trans }}{% else %}{% trans %}Выбрать метро{% endtrans %}{% endif %}</a>
</li>
{% endif %}
{% set search_by_keys_form = search_by_keywords_form() %}
{{ form(search_by_keys_form) }}
{#
<li class=\"nav-item\">
<a class=\"nav-link\" href=\"{{ app.request.requestUri|replace({'/en': ''}) }}\">RU</a>
</li>
<li class=\"nav-item\">
<a class=\"nav-link\" href=\"/en{{ app.request.requestUri|replace({'/en': ''}) }}\">EN</a>
</li>
#}
<li class=\"nav-item\">
<a class=\"nav-link\" href=\"{{ toggle_url_locale('ru') }}\">RU</a>
</li>
<li class=\"nav-item\">
<a class=\"nav-link\" href=\"{{ toggle_url_locale('en') }}\">EN</a>
</li>
</ul>
<ul class=\"navbar-nav\">
{% if app.user %}
<li class=\"nav-item\"><a href=\"{{ is_user_advertiser(app.user) ? path('account') : path('account.favourites.profiles') }}\" class=\"nav-link\">Личный кабинет</a></li>
<li class=\"nav-item\"><a href=\"{{ path('logout') }}\" class=\"nav-link\">Выход</a></li>
{% else %}
<li class=\"nav-item\"><a href=\"{{ path('register', {'city': currentCity.uriIdentity}) }}\" class=\"nav-link\">Регистрация</a></li>
{#<li class=\"nav-item\"><a href=\"{{ path('register_customer', {'city': currentCity.uriIdentity}) }}\" class=\"nav-link\">Регистрация</a></li>#}
<li class=\"nav-item\"><a href=\"{{ path('login') }}\" class=\"nav-link\">Вход</a></li>
{% endif %}
</ul>
</div>
</div>
</nav>
{{ knp_menu_render('navbar', {'template': '_menu/navbar.html.twig'}) }}
{#
{% include \"_menu/account_left_menu.html.twig\" %}#}
{% set avatar = user_avatar() %}
{% if avatar %}
<img src=\"{{asset(avatar.path, 'user_media')}}\" width=\"150\" />
{% endif %}
{% if app.user %}
<p><strong>Баланс:</strong> {{ app.user.currentBalance|money_format }}</p>
<p><strong>Расход:</strong> {{ owner_charges()|money_format }}/час</p>
{% endif %}
{{ knp_menu_render('account_left', {'template': '_menu/account_left.html.twig'}) }}
", "_component/header.html.twig", "/app/templates/_component/header.html.twig");
}
}