No Description

base.html 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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><a href="{% url "report:customer_templates-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">Customer Templates</span></a></li>
  66. <li><a href="{% url "report:product_drawings-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">Drawing</span></a></li>
  67. <li>
  68. <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">
  69. <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">
  70. <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"/>
  71. </svg>
  72. <span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">Data Tables</span>
  73. <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
  74. <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
  75. </svg>
  76. </button>
  77. <ul id="dropdown-example" class="hidden py-2 space-y-2">
  78. <li>
  79. <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>
  80. </li>
  81. <li>
  82. <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>
  83. </li>
  84. <li>
  85. <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>
  86. </li>
  87. <li>
  88. <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>
  89. </li>
  90. <li>
  91. <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>
  92. </li>
  93. <li>
  94. <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>
  95. </li>
  96. <li>
  97. <a href="{% url "legacy:rotatebrokentest-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 Broken Test</a>
  98. </li>
  99. <li>
  100. <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>
  101. </li>
  102. <li>
  103. <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>
  104. </li>
  105. <li>
  106. <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>
  107. </li>
  108. <li>
  109. <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>
  110. </li>
  111. <li>
  112. <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>
  113. </li>
  114. <li>
  115. <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>
  116. </li>
  117. <li>
  118. <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>
  119. </li>
  120. <li>
  121. <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>
  122. </li>
  123. <li>
  124. <a href="{% url "legacy:manualsize-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">Manual Size</a>
  125. </li>
  126. <li>
  127. <a href="{% url "legacy:allproductdimension-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">Product Dimension</a>
  128. </li>
  129. </ul>
  130. </li>
  131. <li>
  132. <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">
  133. <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">
  134. <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"/>
  135. </svg>
  136. <span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">Settings</span>
  137. <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
  138. <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
  139. </svg>
  140. </button>
  141. <ul id="setting-sub" class="hidden py-2 space-y-2">
  142. <li>
  143. <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>
  144. </li>
  145. </ul>
  146. </li>
  147. </ul>
  148. </div>
  149. </aside>
  150. {% endif %}
  151. <!-- Main Content -->
  152. <div class="flex flex-col min-h-screen">
  153. <!-- Content Area -->
  154. <div class="flex-grow p-4 sm:ml-64">
  155. <div class="mt-14">
  156. {% if messages %}
  157. <div class="container mx-auto px-4 py-4">
  158. {% for message in messages %}
  159. <div id="message-alert"
  160. class="p-4 mb-4 text-white rounded-lg bg-green-500 transition-opacity duration-500"
  161. style="opacity: 1;">
  162. {{ message }}
  163. </div>
  164. {% endfor %}
  165. </div>
  166. {% endif %}
  167. {% render_breadcrumbs bs %}
  168. {% block content %}{% endblock %}
  169. </div>
  170. </div>
  171. <!-- Footer -->
  172. <footer class="bg-gray-200 py-4 text-center">
  173. <p class="text-sm text-gray-600">&copy; 2024 My Django App. All rights reserved.</p>
  174. </footer>
  175. <script type="text/javascript" src="{% static "underscore/underscore-min.js" %}"></script>
  176. <script src="https://cdn.jsdelivr.net/npm/flowbite@2.5.2/dist/flowbite.min.js"></script>
  177. {% django_browser_reload_script %}
  178. <script>
  179. // Auto-hide the message after 5 seconds
  180. setTimeout(() => {
  181. const alert = document.getElementById('message-alert');
  182. if (alert) {
  183. alert.style.opacity = '0'; // Fade out
  184. setTimeout(() => alert.remove(), 500); // Remove after fade-out
  185. }
  186. }, 5000); // 5 seconds
  187. </script>
  188. {% block footer_script %}
  189. {% endblock %}
  190. </body>
  191. </html>