index.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. {% extends 'SharixAdmin/base.html' %}
  2. {% load static %}
  3. {% block content %}
  4. <input type="checkbox" name="" style="display: none;" checked id="hideMenuCheckBox">
  5. <div class="container-fluid">
  6. <div class="row">
  7. <div class="col-3" id="leftmainpage">
  8. <div class="d-flex flex-column p-2" style="width: 100%; min-width: 80px; height: 800px; border-radius: 15px; box-shadow: 4px 5px 40px #cfcfcf; margin-top: 50px;">
  9. <a class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-decoration-none"
  10. onclick="barMenuHide()"
  11. style="cursor: pointer;">
  12. <img src="{% static 'SharixAdmin/img/menu/arrow-right.svg' %}"
  13. style="width: 30px; height: 30px; rotate: 180deg; color: #0081ff; transition-duration: 0.4s;"
  14. class="mx-3 my-2" id="row-bar-menu" alt="">
  15. <span class="fs-4" id="sharix-menu-row">ShariX Menu</span>
  16. </a>
  17. <hr>
  18. <ul class="nav nav-pills flex-column mb-auto">
  19. {% for item in menu %}
  20. {% if item.link == url_path %}
  21. <li class="nav-item">
  22. <a class="nav-link active" >
  23. {% with 'SharixAdmin/img/menu/'|add:item.sel|add:'_w.svg' as image_static %}
  24. <img src="{% static image_static %}" alt="" style="width: 30px; height: 30px; ">
  25. {% endwith %}
  26. <span class="hidemenu">{{ item.title }}</span>
  27. </a>
  28. </li>
  29. {% elif item.link == 'tickets' %}
  30. <li class="nav-item">
  31. <a href="{% url 'tickets:ticket_list_list' %}" class="nav-link" >
  32. {% with 'SharixAdmin/img/menu/'|add:item.sel|add:'.svg' as image_static %}
  33. <img src="{% static image_static %}" alt="" style="width: 30px; height: 30px;">
  34. {% endwith %}
  35. <span class="hidemenu">{{ item.title }}</span>
  36. </a>
  37. </li>
  38. {% elif item.link == 'course' %}
  39. <li class="nav-item">
  40. <a href="http://study.reversea.net/" class="nav-link" >
  41. {% with 'SharixAdmin/img/menu/'|add:item.sel|add:'.svg' as image_static %}
  42. <img src="{% static image_static %}" alt="" style="width: 30px; height: 30px;">
  43. {% endwith %}
  44. <span class="hidemenu">{{ item.title }}</span>
  45. </a>
  46. </li>
  47. {% else %}
  48. <li class="nav-item">
  49. <a href="{% url item.link %}" class="nav-link" >
  50. {% with 'SharixAdmin/img/menu/'|add:item.sel|add:'.svg' as image_static %}
  51. <img src="{% static image_static %}" alt="" style="width: 30px; height: 30px; ">
  52. {% endwith %}
  53. <span class="hidemenu">{{ item.title }}</span>
  54. </a>
  55. </li>
  56. {% endif%}
  57. {% endfor %}
  58. </ul>
  59. <hr>
  60. <div class="dropdown">
  61. <a href="#" class="d-flex align-items-center link-dark text-decoration-none dropdown-toggle" id="dropdownUser2" data-bs-toggle="dropdown" aria-expanded="false">
  62. <img alt="" width="32" height="32" class="rounded-circle me-2">
  63. <strong id="user-name-exit">{{ request.user.username }}</strong>
  64. </a>
  65. <ul class="dropdown-menu text-small shadow" aria-labelledby="dropdownUser2">
  66. <li><a class="dropdown-item" href="#">Контакты</a></li>
  67. <li><a class="dropdown-item" href="#">Условия использования</a></li>
  68. <li><a class="dropdown-item" href="#">Политика конфиденциальноти</a></li>
  69. <li><hr class="dropdown-divider"></li>
  70. <li><a class="btn btn-danger mx-2" href="{% url 'logoutweb' %}">Выйти</a></li>
  71. </ul>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="col-9" id="rightmainpage">
  76. <div class="d-flex flex-column p-4"
  77. style="
  78. width: 100%;
  79. height: 800px;
  80. border-radius: 15px;
  81. background-color:white;
  82. box-shadow: 4px 5px 40px #cfcfcf;
  83. margin-top: 50px;">
  84. {% block contenthome %}
  85. {% endblock contenthome%}
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <script>
  91. hidemenu = document.getElementsByClassName('hidemenu')
  92. shMenuRow = document.getElementById('sharix-menu-row')
  93. usNameExit = document.getElementById('user-name-exit')
  94. rightmainpage = document.getElementById('rightmainpage')
  95. leftmainpage = document.getElementById('leftmainpage')
  96. hideCheck = document.getElementById('hideMenuCheckBox')
  97. rowBarMenu = document.getElementById('row-bar-menu')
  98. function show(){
  99. rowBarMenu.style.transform = 'rotate(0deg)';
  100. shMenuRow.style.display = "inline"
  101. usNameExit.style.display = "inline"
  102. leftmainpage.style.maxWidth = "unset"
  103. leftmainpage.classList.remove("col-1")
  104. leftmainpage.classList.add("col-3")
  105. rightmainpage.classList.remove("col-11")
  106. rightmainpage.classList.add("col-9")
  107. for(var i = 0; i < hidemenu.length; i++){
  108. hidemenu[i].style.display = "inline"; // depending on what you're doing
  109. }
  110. }
  111. function hide(){
  112. rowBarMenu.style.transform = 'rotate(180deg)';
  113. shMenuRow.style.display = "none"
  114. usNameExit.style.display = "none"
  115. leftmainpage.style.maxWidth = "100px"
  116. leftmainpage.classList.remove("col-3")
  117. leftmainpage.classList.add("col-1")
  118. rightmainpage.classList.remove("col-9")
  119. rightmainpage.classList.add("col-11")
  120. for(var i = 0; i < hidemenu.length; i++){
  121. hidemenu[i].style.display = "none"; // depending on what you're doing
  122. }
  123. }
  124. function barMenuHide(){
  125. if(hideCheck.checked == true){
  126. hideCheck.checked = false
  127. hide()
  128. } else {
  129. hideCheck.checked = true
  130. show()
  131. }
  132. }
  133. if(hideCheck.checked == true){
  134. show()
  135. } else {
  136. hide()
  137. }
  138. </script>
  139. {% endblock %}