{% extends 'base.html.twig' %}
{% block maincontent %}
{% if app.request.pathinfo == '/' or app.request.pathinfo == '/shop' %}
<div id="aboveNavSale"><span>Скидка 15% на первый заказ при регистрации.</span>
<a class="cursor-pointer" data-toggle="modal" data-target=".bd-example-modal-lg">Зарегистрироваться</a></div>
{% endif %}
<nav class="navbar navbar-expand-lg navbar-light bg-light"
{% if app.request.pathinfo == '/' or app.request.pathinfo == '/shop' %} style="margin-top: 20px" {% endif %}>
<a style="padding-top: .17rem !important; margin-left: 40px" class="navbar-brand" href="/">Handmade</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 style="margin-left: 170px" class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="/">Магазин<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/masters">Мастера<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/blog">Выставки<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/about">О нас<span class="sr-only">(current)</span></a>
</li>
</ul>
{% if app.request.pathinfo == '/' or app.request.pathinfo == '/shop' %}
<form id="searchFilter" class="form-inline my-2 my-lg-0">
<div class="spinner" id="loadingSpinner"></div>
<input style="width: 800px" name="search" id="searchBar" class="form-control mr-sm-2" type="search" placeholder="Поиск" aria-label="Search" oninput="showCross()">
<span id="clearSearch" class="clear-search" onclick="clearSearch()">✖</span>
<button onclick="filter()" class="btn btn-outline-success my-2 my-sm-0 buttonSearch" type="submit">Искать</button>
</form>
{% endif %}
{% if app.user %}
<div class="dropdown">
<a data-bs-toggle="dropdown"
aria-expanded="false">
{% if app.user.iconPath %}
{% if is_granted('ROLE_ADMIN') %}
<div id="profileIcon" style="margin: 0 10px">
<img class="radius-70x70" width="40" height="42" src="{{ app.user.iconPath }}" alt="avatar" style="object-fit: cover">
</div>
{% else %}
<div id="profileIcon" style="margin: 0 10px">
<img class="radius-70x70" width="40" height="42" src="{{ app.user.iconPath }}" alt="avatar" style="object-fit: cover">
</div>
{% endif %}
{% else %}
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODERATOR') %}
<div id="profileIcon" style="margin: 0 10px">
<img width="40" src="/assets/images/icons/iconProfile.png">
</div>
{% else %}
<div id="profileIcon" style="margin: 0 10px">
<img width="40" src="/assets/images/icons/iconProfile.png">
</div>
{% endif %}
{% endif %}
</a>
<ul class="dropdown-menu dropdown-menu-right dropdown-menu-dark text-small shadow" style="right: 0; left: auto">
<li> <span class="dropdown-item disabled" style="color: #6b645b">{{ app.user.name }} {{ app.user.lastname }}</span></li>
<li>
<hr class="dropdown-divider">
</li>
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODERATOR') %}
<li><a class="dropdown-item" href="/admin/info">Меню админа</a></li>
{% elseif is_granted('ROLE_SELLER') %}
<li><a class="dropdown-item" href="/profile/info">Мой профиль</a></li>
{% endif %}
<li><a class="dropdown-item" href="/buyer/orders">Мои заказы</a></li>
<li><a class="dropdown-item" href="/buyer/individualProducts">Мои индивидуальные заказы</a></li>
<li><a class="dropdown-item" href="/cart">Корзина</a></li>
{% if not is_granted('ROLE_SELLER') %}
<li>
<hr class="dropdown-divider">
</li>
<li><a class="dropdown-item" href="/register/becomeSeller">Стать продавцом</a></li>
{% endif %}
<li>
<hr class="dropdown-divider">
</li>
<li><a class="dropdown-item" href="/logout">Выйти</a></li>
</ul>
</div>
{% else %}
<div id="profileLoginSignup">
<a style="margin-right: 10px" href="/profile/info">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-person" viewBox="0 0 14 14">
<path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4Zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10Z"></path>
</svg>
</a>
</div>
{% endif %}
<div style="margin-right: 20px">
<a href="/cart">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" fill="currentColor"
class="bi bi-cart" viewBox="0 0 16 16">
<path d="M0 1.5A.5.5 0 0 1 .5 1H2a.5.5 0 0 1 .485.379L2.89 3H14.5a.5.5 0 0 1 .491.592l-1.5 8A.5.5 0 0 1 13 12H4a.5.5 0 0 1-.491-.408L2.01 3.607 1.61 2H.5a.5.5 0 0 1-.5-.5zM3.102 4l1.313 7h8.17l1.313-7H3.102zM5 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm-7 1a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm7 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
</svg>
</a>
</div>
</div>
</nav>
<!-- Modal -->
<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div style="top:100px;" class="modal-dialog modal-lg">
<div class="modal-content">
<div style="height: 550px">
<div id="buyer" class="container tab-pane active"><br>
{% for flash_error in app.flashes('verify_email_error') %}
<div class="alert alert-danger" role="alert">{{ flash_error }}</div>
{% endfor %}
{% if app.request.pathinfo == '/' or app.request.pathinfo == '/shop' %}
<section id="registerFormFromNav">
{{ form_start(registrationFormBuyer, {
'attr': {'class': 'form-signin'}
}) }}
<a href="https://imperial-obninsk.com/ru" target="_blank"><img class="radius-70x70"
src="/assets/images/icons/iconImperial70x70.png"></a>
<h1 class="h3 mb-3 font-weight-normal">Регистрация</h1>
{{ form_row(registrationFormBuyer.name, {
label: false,
'attr': {'class': 'form-control inputs-form-registration', 'placeholder': 'Ваше имя'}
}) }}
{{ form_row(registrationFormBuyer.email, {
label: false,
'attr': {'class': 'form-control inputs-form-registration', 'placeholder': 'Электронная почта'}
}) }}
<div id="textConditionRegister">
{{ form_row(registrationFormBuyer.agreeTerms, {
label: false,
}) }}
<a>Я принимаю условия </a><a class="color-black link" href="/#">Пользовательского соглашения</a>
<a>и даю своё согласие Handmade на обработку моей персональной информации на условиях,
определенных </a><a class="color-black link" href="/#">Политикой
конфеденциальности</a><a>.</a><br>
</div>
<button type="submit" class="btn btn-lg btn-primary btn-block button-sumbit">Зарегистрироваться
</button>
<button type="button" class="btn btn-lg btn-primary btn-block button-sumbit" data-dismiss="modal">Отмена</button>
<br>
{{ form_end(registrationFormBuyer) }}
<a href="/login" class="link text-decoration-none">Уже есть аккаунт? Войти</a>
</section>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<div class="main-content">
{% block content %}{% endblock %}
</div>
{% endblock %}
{% block navscripts %}
{% block pagescripts %}{% endblock %}
{% endblock %}