topnav.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
  2. <button type="button" id="sidebarCollapse" class="btn btn-outline-success my-2 my-sm-0 nonactive">
  3. <span>Боковое меню</span>
  4. </button>
  5. <a class="navbar-brand" href="{% url 'mainapp:index' %}">Наименование</a>
  6. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse"
  7. aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
  8. <span class="navbar-toggler-icon"></span>
  9. </button>
  10. <div class="collapse navbar-collapse" id="navbarCollapse">
  11. <ul class="navbar-nav mr-auto">
  12. <li class="nav-item">
  13. <a class="nav-link" href="{% url 'mainapp:other' page='about' %}">О сайте</a>
  14. </li>
  15. <li class="nav-item">
  16. <a class="nav-link" href="{% url 'mainapp:other' page='contacts' %}">Контакты</a>
  17. </li>
  18. {% if user.is_authenticated %}
  19. <li class="nav-item dropdown">
  20. <a id="link-user-name" class="nav-link custom-nav-link" data-toggle="dropdown"
  21. href="#"
  22. aria-expanded="false">{{ user.username }}</a>
  23. <div class="dropdown-menu">
  24. <a class="dropdown-item" href="{% url 'mainapp:profile' %}">Мои статьи</a>
  25. <a class="dropdown-item" href="{% url 'mainapp:profile_change' %}">Изменить личные
  26. данные</a>
  27. <a class="dropdown-item" href="{% url 'mainapp:password_change' %}">Изменить пароль</a>
  28. {% if user.is_staff %}
  29. <div class="dropdown-divider"></div>
  30. <a class="dropdown-item" href="/admin" target="_blank">Админка</a>
  31. {% endif %}
  32. <div class="dropdown-divider"></div>
  33. <a class="dropdown-item" href="{% url 'mainapp:logout' %}">Выйти</a>
  34. <div class="dropdown-divider"></div>
  35. <a class="dropdown-item" href="{% url 'mainapp:profile_delete' %}">Удалить аккаунт</a>
  36. </div>
  37. </li>
  38. {% else %}
  39. <li class="nav-item"><a class="nav-link custom-nav-link"
  40. href="{% url 'mainapp:register' %}">Регистрация</a>
  41. </li>
  42. <li class="nav-item"><a class="nav-link custom-nav-link"
  43. href="{% url 'mainapp:login' %}">Вход</a>
  44. </li>
  45. {% endif %}
  46. </ul>
  47. </div>
  48. </nav>