index.html 7.2 KB

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