No Description

base.html 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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">Measurement</a>
  81. </li>
  82. <li>
  83. <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>
  84. </li>
  85. <li>
  86. <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>
  87. </li>
  88. <li>
  89. <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>
  90. </li>
  91. <li>
  92. <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>
  93. </li>
  94. <li>
  95. <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>
  96. </li>
  97. <li>
  98. <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>
  99. </li>
  100. <li>
  101. <a href="#" 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">Invoice</a>
  102. </li>
  103. </ul>
  104. </li>
  105. <li><a href="/settings/" 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">Settings</span></a></li>
  106. </ul>
  107. </div>
  108. </aside>
  109. {% endif %}
  110. <!-- Main Content -->
  111. <div class="flex flex-col min-h-screen">
  112. <!-- Content Area -->
  113. <div class="flex-grow p-4 sm:ml-64">
  114. <div class="mt-14">
  115. {% if messages %}
  116. <div class="container mx-auto px-4 py-4">
  117. {% for message in messages %}
  118. <div id="message-alert"
  119. class="p-4 mb-4 text-white rounded-lg bg-green-500 transition-opacity duration-500"
  120. style="opacity: 1;">
  121. {{ message }}
  122. </div>
  123. {% endfor %}
  124. </div>
  125. {% endif %}
  126. {% render_breadcrumbs bs %}
  127. {% block content %}{% endblock %}
  128. </div>
  129. </div>
  130. <!-- Footer -->
  131. <footer class="bg-gray-200 py-4 text-center">
  132. <p class="text-sm text-gray-600">&copy; 2024 My Django App. All rights reserved.</p>
  133. </footer>
  134. <script type="text/javascript" src="{% static "underscore/underscore-min.js" %}"></script>
  135. <script src="https://cdn.jsdelivr.net/npm/flowbite@2.5.2/dist/flowbite.min.js"></script>
  136. {% django_browser_reload_script %}
  137. <script>
  138. // Auto-hide the message after 5 seconds
  139. setTimeout(() => {
  140. const alert = document.getElementById('message-alert');
  141. if (alert) {
  142. alert.style.opacity = '0'; // Fade out
  143. setTimeout(() => alert.remove(), 500); // Remove after fade-out
  144. }
  145. }, 5000); // 5 seconds
  146. </script>
  147. {% block footer_script %}
  148. {% endblock %}
  149. </body>
  150. </html>