Преглед на файлове

20240722_1046
Work on Helpers

Rene преди 1 година
родител
ревизия
d233dd7ff0
променени са 3 файла, в които са добавени 16 реда и са изтрити 17 реда
  1. BIN
      db.sqlite3
  2. 2 2
      main/views.py
  3. 14 15
      templates/main/current_week_shifts.html

BIN
db.sqlite3


+ 2 - 2
main/views.py

@@ -153,8 +153,8 @@ def current_week_shifts(request):
         'calendar_week': calendar_week,
     }
     #print(shifts_by_employee)
-    #print(events_by_location)
-    #print(helpers_by_date)
+    print(events_by_location)
+    print(helpers_by_date)
     return render(request, 'main/current_week_shifts.html', context)
 
 

+ 14 - 15
templates/main/current_week_shifts.html

@@ -19,8 +19,8 @@
         }
         .shift-none {
             background-color: white !important;
-            text-align: center;
-            cursor: pointer;
+            text-align: center !important;
+            cursor: pointer !important;
         }
         .shift-vacation {
             background-color: blue !important;
@@ -123,21 +123,20 @@
                     {% endfor %}
                     <tr>
                         <td class="employee-name">Helfer</td>
-                        {% for helper in helpers_by_date %}
-                                {% if helper == None %}
-                                    <td class="shift-none"> -/-</td>
+                        {% for day in range_days %}
+                            {% if helpers_by_date|default_if_none:None %}
+                                {% if helpers_by_date|get_item:day %}
+                                    {% with helper=helpers_by_date|get_item:day %}
+                                        <td align="center" class="shift-none">
+                                            {{ helper.ben }}/{{ helper.best }}
+                                        </td>
+                                    {% endwith %}
                                 {% else %}
-                                    <td class="shift-none">
-                                            {% if helper.ben %}
-
-                                                {{ helper.ben }} / {{ helper.best }}
-                                            {% else %}
-                                                -/-
-                                            {% endif %}
-                                    </td>
+                                    <td class="shift-none">-/-</td>
                                 {% endif %}
-
-
+                            {% else %}
+                                <td class="shift-none">-/-</td>
+                            {% endif %}
                         {% endfor %}
                     </tr>