public.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. {% load static %}
  2. {% load custom_tags %}
  3. {% load bootstrap5 %}
  4. <!DOCTYPE html>
  5. <html lang="de">
  6. <head>
  7. <meta charset="UTF-8">
  8. <meta http-equiv="refresh" content="120; URL=/" >
  9. <title>Schichten der aktuellen Woche</title>
  10. <link rel="icon" href="{% static 'favicon.png' %}">
  11. {% bootstrap_css %}
  12. <style>
  13. body {
  14. font-family: Tahoma, sans-serif;
  15. margin: 0;
  16. padding: 0;
  17. font-size: 10px; /* Set the base font size */
  18. }
  19. .shift-none {
  20. background-color: white !important;
  21. text-align: center !important;
  22. {% if user.is_authenticated %}
  23. cursor: pointer !important;
  24. {% endif %}
  25. }
  26. .shift-vacation {
  27. background-color: blue !important;
  28. color: white !important;
  29. text-align: center;
  30. }
  31. .shift-sick {
  32. background-color: yellow !important;
  33. text-align: center;
  34. }
  35. .shift-other {
  36. background-color: gray !important;
  37. color: white !important;
  38. text-align: center;
  39. }
  40. .buttons-container {
  41. display: flex;
  42. justify-content: space-between;
  43. padding: 10px;
  44. background-color: #f8f9fa;
  45. border-bottom: 1px solid #dee2e6;
  46. }
  47. .container-fluid {
  48. padding-top: 10px; /* Reduce the padding to remove extra space */
  49. }
  50. a {
  51. color: black;
  52. text-decoration: none;
  53. }
  54. a:hover {
  55. color: black;
  56. }
  57. .employee-name {
  58. text-align: left;
  59. font-weight: bold;
  60. width: 150px; /* Set a fixed width for the employee column */
  61. }
  62. .day-name {
  63. text-align: center;
  64. width: 150px; /* Set a fixed width for the employee column */
  65. }
  66. .table th, .table td {
  67. vertical-align: middle;
  68. width: 100px; /* Set a fixed width for all other columns */
  69. padding: 4px; /* Reduce padding to decrease row height */
  70. line-height: 1.2; /* Adjust line height to decrease row height */
  71. }
  72. .custom-heading {
  73. margin: 0; /* Remove margin to eliminate extra space */
  74. }
  75. @media print {
  76. .btn {
  77. display: none; /* Hide the buttons when printing */
  78. }
  79. }
  80. </style>
  81. </head>
  82. <body>
  83. <div class="container-fluid">
  84. <table class="table">
  85. <tr>
  86. <td><a href="?start_date={{ previous_week }}" class="btn btn-primary text-start">Eine Woche zurück</a></td>
  87. <td><a href="/" class="btn btn-primary">Aktuelle Woche</a></td>
  88. <td><h4 class="custom-heading text-center">Dienstplan für KW {{ calendar_week }}</h4></td>
  89. <td class="text-end">{% if user.is_authenticated %}
  90. <form method="post" action="{% url 'logout' %}" style="display: inline;">
  91. {% csrf_token %}
  92. <button type="submit" class="btn btn-secondary">Logout</button>
  93. </form>
  94. {% else %}
  95. <a href="/login/" class="btn btn-secondary">Login</a>
  96. {% endif %}</td>
  97. <td class="text-end"><a href="?start_date={{ next_week }}" class="btn btn-primary">Eine Woche vorwärts</a></td>
  98. </tr>
  99. </table>
  100. <div class="table-responsive">
  101. <table class="table table-bordered table-striped table-hover w-100">
  102. <thead class="table-dark">
  103. <tr>
  104. <th class="employee-name">Veranstaltungen</th>
  105. {% for day, date in days_with_dates %}
  106. <th class="day-name">{{ day }} {{ date }}</th>
  107. {% endfor %}
  108. </tr>
  109. </thead>
  110. <tbody>
  111. {% for location, events in events_by_location.items %}
  112. <tr>
  113. <td class="employee-name">{{ location.name }}</td>
  114. {% for day, date in days_with_dates %}
  115. {% with event=events|get_item:forloop.counter0 %}
  116. {% if event == None %}
  117. {% if user.is_authenticated %}
  118. <td class="shift-none" onclick="window.location.href='{% url 'create_event' %}?date={{ date }}'"></td>
  119. {% endif %}
  120. {% else %}
  121. <td class="shift-none" {% if user.is_authenticated %} onclick="window.location.href='{% url 'edit_event' pk=event.id %}'" {% endif %} data-bs-toggle="tooltip" data-bs-placement="top" data-bs-html="true" title="Name: {{ event.name }}<br> Location: {{ event.location }}<br> Belegung: {{ event.belegung }}<br> PAX: {{ event.pax }}<br> CVD: {{ event.cvd }}<br> CVT: {{ event.cvt }}<br> Info: {{ event.info }}">
  122. {% if event.name %}
  123. {{ event.name }}
  124. {% else %}
  125. F
  126. {% endif %}
  127. </td>
  128. {% endif %}
  129. {% endwith %}
  130. {% endfor %}
  131. </tr>
  132. {% endfor %}
  133. <tr>
  134. <td class="employee-name">Reinigung</td>
  135. {% for day in range_days %}
  136. {% if reinigungs_by_date|default_if_none:None %}
  137. {% if reinigungs_by_date|get_item:day %}
  138. {% with reinigung=reinigungs_by_date|get_item:day %}
  139. <td class="shift-none" {% if user.is_authenticated %} onclick="window.location.href='{% url 'edit_reinigung' pk=reinigung.id %}'" {% endif %}>
  140. {{ reinigung.auftrag }}
  141. </td>
  142. {% endwith %}
  143. {% else %}
  144. <td class="shift-none" {% if user.is_authenticated %} onclick="window.location.href='{% url 'create_reinigung' %}?date={{ date }}'" {% endif %}>--</td>
  145. {% endif %}
  146. {% else %}
  147. <td class="shift-none" {% if user.is_authenticated %} onclick="window.location.href='{% url 'create_reinigung' %}?date={{ date }}'" {% endif %}>--</td>
  148. {% endif %}
  149. {% endfor %}
  150. </tr>
  151. <tr>
  152. <td class="employee-name">Helfer</td>
  153. {% for day in range_days %}
  154. {% if helpers_by_date|default_if_none:None %}
  155. {% if helpers_by_date|get_item:day %}
  156. {% with helper=helpers_by_date|get_item:day %}
  157. <td class="shift-none" {% if user.is_authenticated %} onclick="window.location.href='{% url 'edit_helper' pk=helper.id %}'" {% endif %}>
  158. {{ helper.ben }}/{{ helper.best }}
  159. </td>
  160. {% endwith %}
  161. {% else %}
  162. <td class="shift-none" {% if user.is_authenticated %} onclick="window.location.href='{% url 'create_helper' %}?date={{ date }}'" {% endif %}>--</td>
  163. {% endif %}
  164. {% else %}
  165. <td class="shift-none" {% if user.is_authenticated %} onclick="window.location.href='{% url 'create_helper' %}?date={{ date }}'" {% endif %}>--</td>
  166. {% endif %}
  167. {% endfor %}
  168. </tr>
  169. </tbody>
  170. <tbody>
  171. <tr class="table-dark">
  172. <th class="employee-name">Mitarbeiter</th>
  173. {% for day, date in days_with_dates %}
  174. <th class="day-name">{{ day }} {{ date }}</th>
  175. {% endfor %}
  176. </tr>
  177. {% for employee, shifts in shifts_by_employee.items %}
  178. <tr>
  179. <td class="employee-name">{{ employee.name }}</td>
  180. {% for day, date in days_with_dates %}
  181. {% with shift=shifts|get_item:forloop.counter0 %}
  182. {% if shift == None %}
  183. <td class="shift-none" {% if user.is_authenticated %} onclick="window.location.href='{% url 'create_multiple_shifts' %}?date={{ date }}'"{% endif %}>
  184. F
  185. </td>
  186. {% else %}
  187. <td class="
  188. {% if shift.start and shift.end %}
  189. shift-none
  190. {% elif shift.shifttype == 'U' %}
  191. shift-vacation
  192. {% elif shift.shifttype == 'K' %}
  193. shift-sick
  194. {% else %}
  195. shift-other
  196. {% endif %}
  197. "
  198. {% if user.is_authenticated %}
  199. onclick="window.location.href='{% url 'edit_shift' pk=shift.id %}'"
  200. {% endif %}
  201. {% if shift.info %}
  202. data-bs-toggle="tooltip" data-bs-placement="top" data-bs-html="true" title="Info: {{ shift.info }}"
  203. {% endif %}
  204. >
  205. {% if shift.start and shift.end %}
  206. {{ shift.start|time:"H:i" }} - {{ shift.end|time:"H:i" }}
  207. {% if shift.shiftchef %}
  208. {{ shift.shiftchef }}
  209. {% endif %}
  210. {% else %}
  211. {{ shift.get_shifttype_display }}
  212. {% endif %}
  213. </td>
  214. {% endif %}
  215. {% endwith %}
  216. {% endfor %}
  217. </tr>
  218. {% endfor %}
  219. </tbody>
  220. </table>
  221. </div>
  222. </div>
  223. {% bootstrap_javascript %}
  224. <script>
  225. // Initialize all tooltips on the page
  226. var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
  227. var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
  228. return new bootstrap.Tooltip(tooltipTriggerEl)
  229. })
  230. </script>
  231. </body>
  232. </html>