<?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;
/* _navbar.html.twig */
class __TwigTemplate_5d5768d4d201776292905eef86b1a189407f381d8c205d1b250ce3cbbdb343a0 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_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "_navbar.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "_navbar.html.twig"));
// line 1
echo "<nav class=\"navbar navbar-expand-md navbar-light bg-light border-bottom shadow-sm fixed-top py-0\" id=\"navbar\">
<button type=\"button\" class=\"navbar-toggler\" data-toggle=\"collapse\" data-target=\"#sidebar-container\">
<span class=\"sr-only\">";
// line 4
echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("sidebar.toggle", [], "messages");
echo "</span>
<!-- <span class=\"navbar-toggler-icon\"></span> -->
<i class=\"fas fa-folder-open fa-lg fa-fw\"></i>
</button>
<a class=\"navbar-brand\" href=\"";
// line 9
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("homepage");
echo "\"><i class=\"fa fa-microchip\" aria-hidden=\"true\"></i> ";
echo twig_escape_filter($this->env, (isset($context["partdb_title"]) || array_key_exists("partdb_title", $context) ? $context["partdb_title"] : (function () { throw new RuntimeError('Variable "partdb_title" does not exist.', 9, $this->source); })()), "html", null, true);
echo "</a>
<button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarContent\" aria-controls=\"navbarContent\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">
<!-- <span class=\"navbar-toggler-icon\"></span> -->
<i class=\"fas fa-bars fa-lg\"></i>
</button>
<div class=\"collapse navbar-collapse\" id=\"navbarContent\">
<ul class=\"navbar-nav mr-auto\">
";
// line 20
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("@tools.label_scanner")) {
// line 21
echo " <li class=\"nav-item\">
<a class=\"nav-link\" href=\"";
// line 22
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("scan_dialog");
echo "\">";
echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("navbar.scanner.link", [], "messages");
echo "</a>
</li>
";
}
// line 25
echo " </ul>
<div class=\"form-inline my-2 my-lg-0 ml-auto\" id=\"searchbar\">
<!-- Searchbar -->
";
// line 29
$this->loadTemplate("_navbar_search.html.twig", "_navbar.html.twig", 29)->display($context);
// line 30
echo " </div>
<ul class=\"navbar-nav ml-3\" id=\"login-content\">
<li class=\"nav-item dropdown\">
<a href=\"#\" class=\"dropdown-toggle link-anchor nav-link\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">
";
// line 35
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.', 35, $this->source); })()), "user", [], "any", false, false, false, 35)) {
echo "<i class=\"fa fa-user\" aria-hidden=\"true\"></i>";
} else {
echo "<i class=\"far fa-user\" aria-hidden=\"true\"></i>";
}
echo " <span class=\"caret\"></span></a>
<ul class=\"dropdown-menu dropdown-menu-right\" id=\"login-menu\">
";
// line 37
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.', 37, $this->source); })()), "user", [], "any", false, false, false, 37)) {
// line 38
echo " <a class=\"dropdown-item disabled\" href=\"#\" >";
echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("user.loggedin.label", [], "messages");
echo " <b>";
echo twig_escape_filter($this->env, 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.', 38, $this->source); })()), "user", [], "any", false, false, false, 38), "firstName", [], "any", false, false, false, 38), "html", null, true);
echo " ";
echo twig_escape_filter($this->env, 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.', 38, $this->source); })()), "user", [], "any", false, false, false, 38), "lastName", [], "any", false, false, false, 38), "html", null, true);
echo "</b> (@";
echo twig_escape_filter($this->env, 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.', 38, $this->source); })()), "user", [], "any", false, false, false, 38), "name", [], "any", false, false, false, 38), "html", null, true);
echo ")</a>
<a class=\"dropdown-item\" href=\"";
// line 39
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("user_settings");
echo "\"><i class=\"fa fa-cogs fa-fw\" aria-hidden=\"true\"></i> ";
echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("user.settings.label", [], "messages");
echo "</a>
<a class=\"dropdown-item\" href=\"";
// line 40
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("user_info_self");
echo "\"><i class=\"fa fa-info-circle fa-fw\" aria-hidden=\"true\"></i> ";
echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("user.info.label", [], "messages");
echo "</a>
<li role=\"separator\" class=\"dropdown-divider\"></li>
<a class=\"dropdown-item\" href=\"";
// line 42
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("logout");
echo "\" data-no-ajax><i class=\"fa fa-sign-out-alt fa-fw\" aria-hidden=\"true\"></i> ";
echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("user.logout", [], "messages");
echo "</a>
";
} else {
// line 44
echo " <a class=\"dropdown-item\" href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("login", ["_target_path" => $this->extensions['App\Twig\AppExtension']->loginPath(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.', 44, $this->source); })()), "request", [], "any", false, false, false, 44), "pathinfo", [], "any", false, false, false, 44))]), "html", null, true);
echo "\" id=\"login-link\"><i class=\"fa fa-sign-in-alt fa-fw\" aria-hidden=\"true\"></i> ";
echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("user.login", [], "messages");
echo "</a>
";
}
// line 46
echo " <li role=\"separator\" class=\"dropdown-divider\" id=\"toggleDarkmodeSeparator\" hidden></li>
<div class=\"px-4 px-3\" id=\"toggleDarkmodeContainer\" hidden>
<div class=\"custom-control custom-switch\">
<input type=\"checkbox\" class=\"custom-control-input\" id=\"toggleDarkmode\">
<label class=\"custom-control-label\" for=\"toggleDarkmode\">";
// line 50
echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("ui.toggle_darkmode", [], "messages");
echo "</label>
</div>
</div>
<li role=\"separator\" class=\"dropdown-divider\"></li>
<h6 class=\"dropdown-header\">";
// line 54
echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("user.language_select", [], "messages");
echo "</h6>
";
// line 55
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["locale_menu"]) || array_key_exists("locale_menu", $context) ? $context["locale_menu"] : (function () { throw new RuntimeError('Variable "locale_menu" does not exist.', 55, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["locale"]) {
// line 56
echo " <a class=\"dropdown-item\" data-no-ajax href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath(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.', 56, $this->source); })()), "request", [], "any", false, false, false, 56), "attributes", [], "any", false, false, false, 56), "get", [0 => "_route"], "method", false, false, false, 56), twig_array_merge(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 57
(isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 57, $this->source); })()), "request", [], "any", false, false, false, 57), "attributes", [], "any", false, false, false, 57), "get", [0 => "_route_params"], "method", false, false, false, 57), ["_locale" => $context["locale"]])), "html", null, true);
echo "\">
";
// line 58
echo twig_escape_filter($this->env, $this->extensions['Twig\Extra\Intl\IntlExtension']->getLanguageName($context["locale"]), "html", null, true);
echo " (";
echo twig_escape_filter($this->env, twig_upper_filter($this->env, $context["locale"]), "html", null, true);
echo ")</a>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['locale'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 60
echo " </ul>
</li>
</ul>
</div>
</nav>";
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
public function getTemplateName()
{
return "_navbar.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 187 => 60, 177 => 58, 173 => 57, 171 => 56, 167 => 55, 163 => 54, 156 => 50, 150 => 46, 142 => 44, 135 => 42, 128 => 40, 122 => 39, 111 => 38, 109 => 37, 100 => 35, 93 => 30, 91 => 29, 85 => 25, 77 => 22, 74 => 21, 72 => 20, 56 => 9, 48 => 4, 43 => 1,);
}
public function getSourceContext()
{
return new Source("<nav class=\"navbar navbar-expand-md navbar-light bg-light border-bottom shadow-sm fixed-top py-0\" id=\"navbar\">
<button type=\"button\" class=\"navbar-toggler\" data-toggle=\"collapse\" data-target=\"#sidebar-container\">
<span class=\"sr-only\">{% trans %}sidebar.toggle{% endtrans %}</span>
<!-- <span class=\"navbar-toggler-icon\"></span> -->
<i class=\"fas fa-folder-open fa-lg fa-fw\"></i>
</button>
<a class=\"navbar-brand\" href=\"{{ path('homepage') }}\"><i class=\"fa fa-microchip\" aria-hidden=\"true\"></i> {{ partdb_title }}</a>
<button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarContent\" aria-controls=\"navbarContent\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">
<!-- <span class=\"navbar-toggler-icon\"></span> -->
<i class=\"fas fa-bars fa-lg\"></i>
</button>
<div class=\"collapse navbar-collapse\" id=\"navbarContent\">
<ul class=\"navbar-nav mr-auto\">
{% if is_granted(\"@tools.label_scanner\") %}
<li class=\"nav-item\">
<a class=\"nav-link\" href=\"{{ url(\"scan_dialog\") }}\">{% trans %}navbar.scanner.link{% endtrans %}</a>
</li>
{% endif %}
</ul>
<div class=\"form-inline my-2 my-lg-0 ml-auto\" id=\"searchbar\">
<!-- Searchbar -->
{% include \"_navbar_search.html.twig\" %}
</div>
<ul class=\"navbar-nav ml-3\" id=\"login-content\">
<li class=\"nav-item dropdown\">
<a href=\"#\" class=\"dropdown-toggle link-anchor nav-link\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">
{% if app.user %}<i class=\"fa fa-user\" aria-hidden=\"true\"></i>{% else %}<i class=\"far fa-user\" aria-hidden=\"true\"></i>{% endif %} <span class=\"caret\"></span></a>
<ul class=\"dropdown-menu dropdown-menu-right\" id=\"login-menu\">
{% if app.user %}
<a class=\"dropdown-item disabled\" href=\"#\" >{% trans %}user.loggedin.label{% endtrans %} <b>{{ app.user.firstName }} {{app.user.lastName}}</b> (@{{app.user.name}})</a>
<a class=\"dropdown-item\" href=\"{{ path(\"user_settings\") }}\"><i class=\"fa fa-cogs fa-fw\" aria-hidden=\"true\"></i> {% trans %}user.settings.label{% endtrans %}</a>
<a class=\"dropdown-item\" href=\"{{ path(\"user_info_self\") }}\"><i class=\"fa fa-info-circle fa-fw\" aria-hidden=\"true\"></i> {% trans %}user.info.label{% endtrans %}</a>
<li role=\"separator\" class=\"dropdown-divider\"></li>
<a class=\"dropdown-item\" href=\"{{ path('logout') }}\" data-no-ajax><i class=\"fa fa-sign-out-alt fa-fw\" aria-hidden=\"true\"></i> {% trans %}user.logout{% endtrans %}</a>
{% else %}
<a class=\"dropdown-item\" href=\"{{ path('login', {'_target_path': app.request.pathinfo | loginPath}) }}\" id=\"login-link\"><i class=\"fa fa-sign-in-alt fa-fw\" aria-hidden=\"true\"></i> {% trans %}user.login{% endtrans %}</a>
{% endif %}
<li role=\"separator\" class=\"dropdown-divider\" id=\"toggleDarkmodeSeparator\" hidden></li>
<div class=\"px-4 px-3\" id=\"toggleDarkmodeContainer\" hidden>
<div class=\"custom-control custom-switch\">
<input type=\"checkbox\" class=\"custom-control-input\" id=\"toggleDarkmode\">
<label class=\"custom-control-label\" for=\"toggleDarkmode\">{% trans %}ui.toggle_darkmode{% endtrans %}</label>
</div>
</div>
<li role=\"separator\" class=\"dropdown-divider\"></li>
<h6 class=\"dropdown-header\">{% trans %}user.language_select{% endtrans %}</h6>
{% for locale in locale_menu %}
<a class=\"dropdown-item\" data-no-ajax href=\"{{ path(app.request.attributes.get('_route'),
app.request.attributes.get('_route_params')|merge({'_locale': locale})) }}\">
{{ locale|language_name }} ({{ locale|upper }})</a>
{% endfor %}
</ul>
</li>
</ul>
</div>
</nav>", "_navbar.html.twig", "/var/www/part-db/templates/_navbar.html.twig");
}
}