current_week_shifts.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. <title>Schichten der aktuellen Woche</title>
  9. <link rel="icon" href="{% static 'favicon.png' %}">
  10. {% bootstrap_css %}
  11. <style>
  12. body {
  13. font-family: Tahoma, sans-serif;
  14. margin: 0;
  15. padding: 0;
  16. font-size: 10px; /* Set the base font size */
  17. }
  18. .shift-none {
  19. background-color: white !important;
  20. text-align: center;
  21. }
  22. .shift-vacation {
  23. background-color: blue !important;
  24. color: white !important;
  25. text-align: center;
  26. }
  27. .shift-sick {
  28. background-color: yellow !important;
  29. text-align: center;
  30. }
  31. .shift-other {
  32. background-color: gray !important;
  33. color: white !important;
  34. text-align: center;
  35. }
  36. .buttons-container {
  37. display: flex;
  38. justify-content: space-between;
  39. padding: 10px;
  40. background-color: #f8f9fa;
  41. border-bottom: 1px solid #dee2e6;
  42. }
  43. .container-fluid {
  44. padding-top: 10px; /* Reduce the padding to remove extra space */
  45. }
  46. a {
  47. color: black;
  48. text-decoration: none;
  49. }
  50. a:hover {
  51. color: black;
  52. }
  53. .employee-name {
  54. text-align: left;
  55. width: 150px; /* Set a fixed width for the employee column */
  56. }
  57. .day-name {
  58. text-align: center;
  59. width: 150px; /* Set a fixed width for the employee column */
  60. }
  61. .table th, .table td {
  62. vertical-align: middle;
  63. width: 100px; /* Set a fixed width for all other columns */
  64. }
  65. .custom-heading {
  66. margin: 0; /* Remove margin to eliminate extra space */
  67. }
  68. @media print {
  69. .buttons-container {
  70. display: none; /* Hide the buttons when printing */
  71. }
  72. }
  73. </style>
  74. </head>
  75. <body>
  76. <div class="buttons-container">
  77. <a href="?start_date={{ previous_week }}" class="btn btn-primary">Eine Woche zurück</a>
  78. <a href="?start_date={{ next_week }}" class="btn btn-primary">Eine Woche vorwärts</a>
  79. </div>
  80. <div class="container-fluid">
  81. <h4 class="custom-heading">Dienstplan für KW {{ calendar_week }} - {{ start_of_week }} bis {{ end_of_week }}</h4>
  82. <div class="table-responsive">
  83. <table class="table table-bordered table-hover w-100">
  84. <thead class="table-dark">
  85. <tr>
  86. <th class="employee-name">Employee</th>
  87. {% for day, date in days_with_dates %}
  88. <th class="day-name">{{ day }} {{ date }}</th>
  89. {% endfor %}
  90. </tr>
  91. </thead>
  92. <tbody>
  93. {% for employee, shifts in shifts_by_employee.items %}
  94. <tr>
  95. <td class="employee-name">{{ employee.name }}</td>
  96. {% for day, date in days_with_dates %}
  97. {% with shift=shifts|get_item:forloop.counter0 %}
  98. {% if shift == None %}
  99. <td class="shift-none">
  100. <a href="{% url 'create_multiple_shifts' %}?date={{ date }}">F</a>
  101. </td>
  102. {% else %}
  103. <td class="
  104. {% if shift.start and shift.end %}
  105. shift-none
  106. {% elif shift.shifttype == 'U' %}
  107. shift-vacation
  108. {% elif shift.shifttype == 'K' %}
  109. shift-sick
  110. {% else %}
  111. shift-other
  112. {% endif %}
  113. ">
  114. <a href="{% url 'edit_shift' pk=shift.id %}">
  115. {% if shift.start and shift.end %}
  116. {{ shift.start|time:"H:i" }} - {{ shift.end|time:"H:i" }}
  117. {% else %}
  118. {{ shift.get_shifttype_display }}
  119. {% endif %}
  120. </a>
  121. </td>
  122. {% endif %}
  123. {% endwith %}
  124. {% endfor %}
  125. </tr>
  126. {% endfor %}
  127. </tbody>
  128. </table>
  129. </div>
  130. </div>
  131. {% bootstrap_javascript %}
  132. </body>
  133. </html>