From 869ec34f23f79a75e68e9c2e2a125577a7726ef9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Benjamin=20H=C3=A4ttasch?=
 <benjamin.haettasch@fachschaft.informatik.tu-darmstadt.de>
Date: Wed, 26 Feb 2025 23:26:07 +0100
Subject: [PATCH] Scheduler: Use default background color for unscheduled slots

Previously, the names of unscheduled slots were shown white on white background when no color for the corresponding category was set. Now, a black background color is used instead.
This fixes #217
---
 AKScheduling/templates/admin/AKScheduling/scheduling.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/AKScheduling/templates/admin/AKScheduling/scheduling.html b/AKScheduling/templates/admin/AKScheduling/scheduling.html
index 2c4a27e5..87253455 100644
--- a/AKScheduling/templates/admin/AKScheduling/scheduling.html
+++ b/AKScheduling/templates/admin/AKScheduling/scheduling.html
@@ -355,7 +355,7 @@
                         <h5 class="mt-2">{{ track_slots.grouper }}</h5>
                     {% endif %}
                     {% for slot in track_slots.list %}
-                        <div class="unscheduled-slot badge" style='background-color: {{ slot.ak.category.color }}'
+                        <div class="unscheduled-slot badge" style='background-color: {% with slot.ak.category.color as color %} {% if color %}{{ color }}{% else  %}#000000;{% endif %}{% endwith %}'
                              {% with slot.ak.details as details %}
                              data-event='{ "title": "{{ slot.ak.short_name }}", "duration": {"hours": "{{ slot.duration|unlocalize }}"}, "constraint": "roomAvailable", "description": "{{ details | escapejs }}", "slotID": "{{ slot.pk }}", "backgroundColor": "{{ slot.ak.category.color }}", "url": "{% url "admin:AKModel_akslot_change" slot.pk %}"}' data-details="{{ details }}">{{ slot.ak.short_name }}
                             ({{ slot.duration }} h)<br>{{ slot.ak.owners_list }}
-- 
GitLab