Bez popisu

base.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. {% load static tailwind_tags %}
  2. {% load django_browser_reload %}
  3. {% load legacy_filters %}
  4. <!DOCTYPE html>
  5. <html lang="en">
  6. <head>
  7. <meta charset="UTF-8">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <title>{% block title %}COI System{% endblock %}</title>
  10. <!-- TailwindCSS -->
  11. <!--
  12. <script src="https://cdn.tailwindcss.com"></script> -->
  13. {% tailwind_css %}
  14. <link href="{% static "font-awesome/css/font-awesome.css" %}" rel="stylesheet" />
  15. <script type="text/javascript" defer src="{% static "alpinejs/dist/cdn.min.js" %}"></script>
  16. <link href="https://cdn.jsdelivr.net/npm/flowbite@2.5.2/dist/flowbite.min.css" rel="stylesheet" />
  17. <script type="text/javascript" src="{% static "axios/dist/axios.js" %}"></script>
  18. <script type="text/javascript" src="{% static "js/main.js" %}"></script>
  19. </head>
  20. <body class="bg-gray-100 text-gray-800">
  21. <!-- Navbar -->
  22. <nav class="fixed top-0 z-50 w-full bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700" >
  23. <div class="px-3 py-3 lg:px-5 lg:pl-3">
  24. <div class="flex items-center justify-between">
  25. <div class="flex items-center justify-start">
  26. <button data-drawer-target="logo-sidebar" data-drawer-toggle="logo-sidebar" aria-controls="logo-sidebar" type="button" class="inline-flex items-center p-2 text-sm text-gray-500 rounded-lg sm:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600">
  27. <span class="sr-only">Open sidebar</span>
  28. <svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
  29. <path clip-rule="evenodd" fill-rule="evenodd" d="M2 4.75A.75.75 0 012.75 4h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 4.75zm0 10.5a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5a.75.75 0 01-.75-.75zM2 10a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 10z"></path>
  30. </svg>
  31. </button>
  32. <a href="/" class="flex items-center ml-2">
  33. <img src="https://flowbite.com/docs/images/logo.svg" class="h-8 mr-3" alt="Logo" />
  34. <span class="self-center text-xl font-semibold dark:text-white">MGT COI</span>
  35. </a>
  36. </div>
  37. <div class="flex items-center space-x-4">
  38. {% if user.is_authenticated %}
  39. <!-- Logged-in User -->
  40. <a href="{% url 'sysadmin:profile' %}"><span class="text-gray-600 dark:text-gray-300">Hello, {{ user.username }}</span></a>
  41. <a href="{% url 'sysadmin:logout' %}" class="text-blue-500 hover:underline">Logout</a>
  42. {% else %}
  43. <!-- Guest User -->
  44. <a href="{% url 'sysadmin:login' %}" class="text-blue-500 hover:underline">Login</a>
  45. <a href="{% url 'sysadmin:register' %}" class="text-blue-500 hover:underline">Register</a>
  46. {% endif %}
  47. <div class="ml-3">
  48. <button type="button" class="flex text-sm bg-gray-800 rounded-full focus:ring-4 focus:ring-gray-300 dark:focus:ring-gray-600">
  49. <span class="sr-only">Open user menu</span>
  50. <img class="w-8 h-8 rounded-full" src="https://flowbite.com/docs/images/people/profile-picture-5.jpg" alt="User">
  51. </button>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </nav>
  57. <!-- Sidebar -->
  58. {% if not hide_sidebar %}
  59. <aside id="logo-sidebar" class="fixed top-0 left-0 z-40 w-64 h-screen pt-20 transition-transform -translate-x-full bg-white border-r border-gray-200 sm:translate-x-0 dark:bg-gray-800 dark:border-gray-700">
  60. <div class="h-full px-3 pb-4 overflow-y-auto">
  61. <ul class="space-y-2">
  62. <li><a href="/dashboard/" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 dark:text-white"><span class="ml-3">Dashboard</span></a></li>
  63. <li><a href="{% url "report:coi-view" %}" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 dark:text-white"><span class="ml-3">COI</span></a></li>
  64. <li><a href="{% url "report:report-list" %}" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 dark:text-white"><span class="ml-3">Reports</span></a></li>
  65. <li>
  66. <button type="button" class="flex items-center w-full p-2 text-base text-gray-900 transition duration-75 rounded-lg group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700" aria-controls="dropdown-example" data-collapse-toggle="dropdown-example">
  67. <svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
  68. <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 6c0 1.657-3.134 3-7 3S5 7.657 5 6m14 0c0-1.657-3.134-3-7-3S5 4.343 5 6m14 0v6M5 6v6m0 0c0 1.657 3.134 3 7 3s7-1.343 7-3M5 12v6c0 1.657 3.134 3 7 3s7-1.343 7-3v-6"/>
  69. </svg>
  70. <span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">Data Tables</span>
  71. <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
  72. <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
  73. </svg>
  74. </button>
  75. <ul id="dropdown-example" class="hidden py-2 space-y-2">
  76. <li>
  77. <a href="{% url "legacy:data-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Data</a>
  78. </li>
  79. <li>
  80. <a href="{% url "legacy:datams-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Data MS</a>
  81. </li>
  82. <li>
  83. <a href="{% url "legacy:datarl-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Data RL</a>
  84. </li>
  85. <li>
  86. <a href="{% url "legacy:datawb-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Data WB</a>
  87. </li>
  88. <li>
  89. <a href="{% url "legacy:datams-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Measurement</a>
  90. </li>
  91. <li>
  92. <a href="{% url "legacy:rotate-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Rotate Data</a>
  93. </li>
  94. <li>
  95. <a href="{% url "legacy:fg-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Fg Press Info</a>
  96. </li>
  97. <li>
  98. <a href="{% url "legacy:ls-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Lot Summary</a>
  99. </li>
  100. <li>
  101. <a href="{% url "legacy:lsrl-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Lot Summary RL</a>
  102. </li>
  103. <li>
  104. <a href="{% url "legacy:lswb-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Lot Summary WB</a>
  105. </li>
  106. <li>
  107. <a href="{% url "legacy:vm-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">VMaster</a>
  108. </li>
  109. <li>
  110. <a href="{% url "legacy:mg-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">MgMaster</a>
  111. </li>
  112. <li>
  113. <a href="{% url "legacy:bel-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">BelMaster</a>
  114. </li>
  115. <li>
  116. <a href="{% url "legacy:em-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">EMaster</a>
  117. </li>
  118. </ul>
  119. </li>
  120. <li>
  121. <button type="button" class="flex items-center w-full p-2 text-base text-gray-900 transition duration-75 rounded-lg group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700" aria-controls="setting-sub" data-collapse-toggle="setting-sub">
  122. <svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
  123. <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 6c0 1.657-3.134 3-7 3S5 7.657 5 6m14 0c0-1.657-3.134-3-7-3S5 4.343 5 6m14 0v6M5 6v6m0 0c0 1.657 3.134 3 7 3s7-1.343 7-3M5 12v6c0 1.657 3.134 3 7 3s7-1.343 7-3v-6"/>
  124. </svg>
  125. <span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">Settings</span>
  126. <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
  127. <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
  128. </svg>
  129. </button>
  130. <ul id="setting-sub" class="hidden py-2 space-y-2">
  131. <li>
  132. <a href="{% url "sysadmin:users-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Users</a>
  133. </li>
  134. </ul>
  135. </li>
  136. </ul>
  137. </div>
  138. </aside>
  139. {% endif %}
  140. <!-- Main Content -->
  141. <div class="flex flex-col min-h-screen">
  142. <!-- Content Area -->
  143. <div class="flex-grow p-4 sm:ml-64">
  144. <div class="mt-14">
  145. {% if messages %}
  146. <div class="container mx-auto px-4 py-4">
  147. {% for message in messages %}
  148. <div id="message-alert"
  149. class="p-4 mb-4 text-white rounded-lg bg-green-500 transition-opacity duration-500"
  150. style="opacity: 1;">
  151. {{ message }}
  152. </div>
  153. {% endfor %}
  154. </div>
  155. {% endif %}
  156. {% render_breadcrumbs bs %}
  157. {% block content %}{% endblock %}
  158. </div>
  159. </div>
  160. <!-- Footer -->
  161. <footer class="bg-gray-200 py-4 text-center">
  162. <p class="text-sm text-gray-600">&copy; 2024 My Django App. All rights reserved.</p>
  163. </footer>
  164. <script type="text/javascript" src="{% static "underscore/underscore-min.js" %}"></script>
  165. <script src="https://cdn.jsdelivr.net/npm/flowbite@2.5.2/dist/flowbite.min.js"></script>
  166. {% django_browser_reload_script %}
  167. <script>
  168. // Auto-hide the message after 5 seconds
  169. setTimeout(() => {
  170. const alert = document.getElementById('message-alert');
  171. if (alert) {
  172. alert.style.opacity = '0'; // Fade out
  173. setTimeout(() => alert.remove(), 500); // Remove after fade-out
  174. }
  175. }, 5000); // 5 seconds
  176. </script>
  177. {% block footer_script %}
  178. {% endblock %}
  179. </body>
  180. </html>