templates/nav.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block maincontent %}
  3.     {% if app.request.pathinfo == '/' or app.request.pathinfo == '/shop' %}
  4.     <div id="aboveNavSale"><span>Скидка 15% на первый заказ при регистрации.</span>
  5.         <a class="cursor-pointer" data-toggle="modal" data-target=".bd-example-modal-lg">Зарегистрироваться</a></div>
  6.     {% endif %}
  7.     <nav class="navbar navbar-expand-lg navbar-light bg-light"
  8.          {% if app.request.pathinfo == '/' or app.request.pathinfo == '/shop' %} style="margin-top: 20px"  {% endif %}>
  9.         <a style="padding-top: .17rem !important; margin-left: 40px" class="navbar-brand" href="/">Handmade</a>
  10.         <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  11.             <span class="navbar-toggler-icon"></span>
  12.         </button>
  13.         <div style="margin-left: 170px" class="collapse navbar-collapse" id="navbarSupportedContent">
  14.             <ul class="navbar-nav mr-auto">
  15.                 <li class="nav-item active">
  16.                     <a class="nav-link" href="/">Магазин<span class="sr-only">(current)</span></a>
  17.                 </li>
  18.                 <li class="nav-item active">
  19.                     <a class="nav-link" href="/masters">Мастера<span class="sr-only">(current)</span></a>
  20.                 </li>
  21.                 <li class="nav-item active">
  22.                     <a class="nav-link" href="/blog">Выставки<span class="sr-only">(current)</span></a>
  23.                 </li>
  24.                 <li class="nav-item active">
  25.                     <a class="nav-link" href="/about">О нас<span class="sr-only">(current)</span></a>
  26.                 </li>
  27.             </ul>
  28.             {% if app.request.pathinfo == '/' or app.request.pathinfo == '/shop' %}
  29.             <form id="searchFilter" class="form-inline my-2 my-lg-0">
  30.                 <div class="spinner" id="loadingSpinner"></div>
  31.                 <input style="width: 800px" name="search" id="searchBar" class="form-control mr-sm-2" type="search" placeholder="Поиск" aria-label="Search" oninput="showCross()">
  32.                 <span id="clearSearch" class="clear-search" onclick="clearSearch()">✖</span>
  33.                 <button onclick="filter()" class="btn btn-outline-success my-2 my-sm-0 buttonSearch" type="submit">Искать</button>
  34.             </form>
  35.             {% endif %}
  36.             {% if app.user %}
  37.                 <div class="dropdown">
  38.                     <a data-bs-toggle="dropdown"
  39.                        aria-expanded="false">
  40.                         {% if app.user.iconPath %}
  41.                             {% if is_granted('ROLE_ADMIN') %}
  42.                                 <div id="profileIcon" style="margin: 0 10px">
  43.                                     <img class="radius-70x70" width="40"  height="42" src="{{ app.user.iconPath }}" alt="avatar" style="object-fit: cover">
  44.                                 </div>
  45.                             {% else %}
  46.                                 <div id="profileIcon" style="margin: 0 10px">
  47.                                     <img class="radius-70x70" width="40" height="42" src="{{ app.user.iconPath }}" alt="avatar" style="object-fit: cover">
  48.                                 </div>
  49.                             {% endif %}
  50.                         {% else %}
  51.                             {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODERATOR') %}
  52.                                 <div id="profileIcon" style="margin: 0 10px">
  53.                                     <img width="40" src="/assets/images/icons/iconProfile.png">
  54.                                 </div>
  55.                             {% else %}
  56.                                 <div id="profileIcon" style="margin: 0 10px">
  57.                                     <img width="40" src="/assets/images/icons/iconProfile.png">
  58.                                 </div>
  59.                             {% endif %}
  60.                         {% endif %}
  61.                     </a>
  62.                     <ul class="dropdown-menu dropdown-menu-right dropdown-menu-dark text-small shadow" style="right: 0; left: auto">
  63.                         <li> <span class="dropdown-item disabled" style="color: #6b645b">{{ app.user.name }} {{ app.user.lastname }}</span></li>
  64.                         <li>
  65.                             <hr class="dropdown-divider">
  66.                         </li>
  67.                         {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODERATOR') %}
  68.                             <li><a class="dropdown-item" href="/admin/info">Меню админа</a></li>
  69.                         {% elseif is_granted('ROLE_SELLER') %}
  70.                             <li><a class="dropdown-item" href="/profile/info">Мой профиль</a></li>
  71.                         {% endif %}
  72.                         <li><a class="dropdown-item" href="/buyer/orders">Мои заказы</a></li>
  73.                         <li><a class="dropdown-item" href="/buyer/individualProducts">Мои индивидуальные заказы</a></li>
  74.                         <li><a class="dropdown-item" href="/cart">Корзина</a></li>
  75.                         {% if not is_granted('ROLE_SELLER') %}
  76.                             <li>
  77.                                 <hr class="dropdown-divider">
  78.                             </li>
  79.                             <li><a class="dropdown-item" href="/register/becomeSeller">Стать продавцом</a></li>
  80.                         {% endif %}
  81.                         <li>
  82.                             <hr class="dropdown-divider">
  83.                         </li>
  84.                         <li><a class="dropdown-item" href="/logout">Выйти</a></li>
  85.                     </ul>
  86.                 </div>
  87.             {% else %}
  88.                 <div id="profileLoginSignup">
  89.                     <a style="margin-right: 10px" href="/profile/info">
  90.                         <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
  91.                              class="bi bi-person" viewBox="0 0 14 14">
  92.                             <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>
  93.                         </svg>
  94.                     </a>
  95.                 </div>
  96.             {% endif %}
  97.             <div style="margin-right: 20px">
  98.                 <a href="/cart">
  99.                     <svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" fill="currentColor"
  100.                          class="bi bi-cart" viewBox="0 0 16 16">
  101.                         <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"/>
  102.                     </svg>
  103.                 </a>
  104.             </div>
  105.         </div>
  106.     </nav>
  107.     <!-- Modal -->
  108.     <div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
  109.         <div style="top:100px;" class="modal-dialog modal-lg">
  110.             <div class="modal-content">
  111.                 <div style="height: 550px">
  112.                     <div id="buyer" class="container tab-pane active"><br>
  113.                         {% for flash_error in app.flashes('verify_email_error') %}
  114.                             <div class="alert alert-danger" role="alert">{{ flash_error }}</div>
  115.                         {% endfor %}
  116.                         {% if app.request.pathinfo == '/' or app.request.pathinfo == '/shop' %}
  117.                             <section id="registerFormFromNav">
  118.                                 {{ form_start(registrationFormBuyer, {
  119.                                     'attr': {'class': 'form-signin'}
  120.                                 }) }}
  121.                                 <a href="https://imperial-obninsk.com/ru" target="_blank"><img class="radius-70x70"
  122.                                                                                                src="/assets/images/icons/iconImperial70x70.png"></a>
  123.                                 <h1 class="h3 mb-3 font-weight-normal">Регистрация</h1>
  124.                                 {{ form_row(registrationFormBuyer.name, {
  125.                                     label: false,
  126.                                     'attr': {'class': 'form-control inputs-form-registration', 'placeholder': 'Ваше имя'}
  127.                                 }) }}
  128.                                 {{ form_row(registrationFormBuyer.email, {
  129.                                     label: false,
  130.                                     'attr': {'class': 'form-control inputs-form-registration', 'placeholder': 'Электронная почта'}
  131.                                 }) }}
  132.                                 <div id="textConditionRegister">
  133.                                     {{ form_row(registrationFormBuyer.agreeTerms, {
  134.                                         label: false,
  135.                                     }) }}
  136.                                     <a>Я принимаю условия </a><a class="color-black link" href="/#">Пользовательского соглашения</a>
  137.                                     <a>и даю своё согласие Handmade на обработку моей персональной информации на условиях,
  138.                                         определенных </a><a class="color-black link" href="/#">Политикой
  139.                                         конфеденциальности</a><a>.</a><br>
  140.                                 </div>
  141.                                 <button type="submit" class="btn btn-lg btn-primary btn-block button-sumbit">Зарегистрироваться
  142.                                 </button>
  143.                                 <button type="button" class="btn btn-lg btn-primary btn-block button-sumbit" data-dismiss="modal">Отмена</button>
  144.                                 <br>
  145.                                 {{ form_end(registrationFormBuyer) }}
  146.                                 <a href="/login" class="link text-decoration-none">Уже есть аккаунт? Войти</a>
  147.                             </section>
  148.                         {% endif %}
  149.                     </div>
  150.                 </div>
  151.             </div>
  152.         </div>
  153.     </div>
  154.     <div class="main-content">
  155.         {% block content %}{% endblock %}
  156.     </div>
  157. {% endblock %}
  158. {% block navscripts %}
  159.     {% block pagescripts %}{% endblock %}
  160. {% endblock %}