Browse Source

Bugfix, Tabelle public, Belegung auf nicht erforderlich

root 9 months ago
parent
commit
f38a17847d
4 changed files with 4 additions and 2 deletions
  1. 0 1
      AD/settings.py
  2. BIN
      db.sqlite3
  3. 1 0
      main/models.py
  4. 3 1
      templates/main/public.html

+ 0 - 1
AD/settings.py

@@ -40,7 +40,6 @@ INSTALLED_APPS = [
     'django.contrib.staticfiles',
     'bootstrap5',
     'main',
-    'django_flatpickr',
 ]
 
 MIDDLEWARE = [

BIN
db.sqlite3


+ 1 - 0
main/models.py

@@ -114,6 +114,7 @@ class Event(models.Model):
         choices=EventBelegung.choices,
         default=EventBelegung.NONE,
         null=True,
+        blank=True,
     )
     pax = models.SmallIntegerField(null=True, blank=True)
     cvd = models.ForeignKey(Employee, related_name='cvt', on_delete=models.SET_NULL, null=True, blank=True)

+ 3 - 1
templates/main/public.html

@@ -116,7 +116,9 @@
                             {% with event=events|get_item:forloop.counter0 %}
                                 {% if event == None %}
                                     {% if user.is_authenticated %}
-                                        <td class="shift-none" onclick="window.location.href='{% url 'create_event' %}?date={{ date }}'"></td>
+                                        <td class="shift-none" onclick="window.location.href='{% url 'create_event' %}?date={{ date }}'">--</td>
+                                    {% else %}
+                                        <td class="shift-none">--</td>
                                     {% endif %}
                                 {% else %}
                                     <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 }}">