diff --git a/db.sqlite3 b/db.sqlite3 index 6ecbe29..696e76e 100755 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/leitstelle/templates/leitstelle/create.html b/leitstelle/templates/leitstelle/create.html index 2ebd525..d876e3f 100755 --- a/leitstelle/templates/leitstelle/create.html +++ b/leitstelle/templates/leitstelle/create.html @@ -3,14 +3,25 @@ {% block content %} + +

Einsatzgenerierung

-
+ {% csrf_token %}

Stichwort:

- {% for sw in sw %} @@ -24,7 +35,7 @@

Freitext

- +
@@ -34,28 +45,53 @@ let item_div = document.getElementById("fz_"+fzid+"_div") let item_cb = document.getElementById("fz_"+fzid+"_cb") if (!item_cb.checked){ - console.log("MOIN NÖ") item_cb.checked = true; item_div.classList.add("fz_activ") } else { - console.log("MOIN JA") item_cb.checked = false; item_div.classList.remove("fz_activ") } } + + function allFZ(){ + let items = Array.from(document.getElementsByClassName("fz_item")) + var cb_all = document.getElementById("all_select") + var all_checked = false + if (cb_all.checked) { + all_checked = true + cb_all.checked = false + document.getElementById("selAll").innerHTML = "Alle Auswählen" + } else { + all_checked = false + cb_all.checked = true + document.getElementById("selAll").innerHTML = "Alle Abwählen" + } + items.forEach(function (item){ + let item_id = item.id + let item_nr = item_id.replace("fz_", "").replace("_div", "") + if (all_checked) { + document.getElementById(item_id).classList.remove("fz_activ") + document.getElementById("fz_"+item_nr+"_cb").checked = false + } else { + document.getElementById(item_id).classList.add("fz_activ") + document.getElementById("fz_"+item_nr+"_cb").checked = true + } + }) + } -

Fahrzeuge

+

FahrzeugeAlle Auswählen

+
{% for fz in fz %} -
+
{{ fz.3 }} - {{ fz.2 }} - +
{% endfor %}
- + ABBRUCH
diff --git a/leitstelle/views.py b/leitstelle/views.py index f2116c3..a5a91e0 100755 --- a/leitstelle/views.py +++ b/leitstelle/views.py @@ -1,5 +1,5 @@ from django.shortcuts import render -from main.models import alarmierung_SW, fahrzeug, leitstelle +from main.models import alarmierung_SW, fahrzeug, leitstelle, alarmierung, feuerwehr # Create your views here. def index(request): @@ -8,6 +8,20 @@ def index(request): def create(request): sw_request = alarmierung_SW.objects.all().values_list() fz_request = fahrzeug.objects.all().order_by('Funkrufname').values_list() + + if request.method == "POST": + print(request.POST) + + newAlarm = alarmierung() + newAlarm.Stichwort = alarmierung_SW.objects.get(id=int(request.POST.get("stichwort"))) + newAlarm.ft = request.POST.get("freitext") + # HINWEIS - NACHFOLGEND IST DAUERHAFT AUF "ALSFELD" GESTELLT DA NOCH KEINE AUSWAHL MÖGLICH + newAlarm.Standort = feuerwehr.objects.get(id=1) + fahrzeuge = request.POST.getlist("fz") + print(fahrzeuge) + newAlarm.fz = str(request.POST.getlist("fz")) + newAlarm.save() + return render(request, 'leitstelle/create.html', {'sw':sw_request, 'fz':fz_request}) def setStation(request): diff --git a/main/models.py b/main/models.py index 3b2f353..64d51ae 100755 --- a/main/models.py +++ b/main/models.py @@ -28,7 +28,7 @@ class alarmierung_SW(models.Model): # ALARMIERUNG class alarmierung(models.Model): - timestamp = models.DateTimeField(auto_created=True) + timestamp = models.DateTimeField(auto_created=True, auto_now_add=True) sw = models.ForeignKey(alarmierung_SW, on_delete=models.CASCADE, name="Stichwort") ft = models.CharField(max_length=100, null=True) fz = models.CharField(max_length=100, null=True) diff --git a/main/static/css/styles.css b/main/static/css/styles.css index fca7d57..176e539 100755 --- a/main/static/css/styles.css +++ b/main/static/css/styles.css @@ -34,3 +34,27 @@ img.pb { .form-control { height: 2.5rem; } + +.blink { + animation-name: animation_blink; + animation-timing-function: ease-in; + animation-duration: 2s; + animation-iteration-count: infinite; +} +@keyframes animation_blink { + 0% { opacity: 1; } + 50% { opacity: 0.1; } + 100% { opacity: 1; } +} + +.shadow_blink { + animation-name: shadow_blink; + animation-timing-function: ease-in; + animation-duration: 2s; + animation-iteration-count: infinite; +} +@keyframes shadow_blink { + 0% { box-shadow: 0 0 2rem rgb(255, 0, 0); } + 50% { box-shadow: 0 0 2rem rgba(255, 0, 0, 0.109); } + 100% { box-shadow: 0 0 2rem rgb(255, 0, 0); } +} \ No newline at end of file diff --git a/main/static/img/alarm.png b/main/static/img/alarm.png new file mode 100644 index 0000000..6352566 Binary files /dev/null and b/main/static/img/alarm.png differ diff --git a/main/static/img/clock.png b/main/static/img/clock.png deleted file mode 100755 index ff09bb3..0000000 Binary files a/main/static/img/clock.png and /dev/null differ diff --git a/main/static/sounds/Audio13.wav b/main/static/sounds/Audio13.wav new file mode 100644 index 0000000..dfb4ed1 Binary files /dev/null and b/main/static/sounds/Audio13.wav differ diff --git a/main/static/sounds/audio6.mp3 b/main/static/sounds/audio6.mp3 new file mode 100644 index 0000000..ed503d8 Binary files /dev/null and b/main/static/sounds/audio6.mp3 differ diff --git a/monitor/static/css/style.css b/monitor/static/css/style.css index 4d69ca8..e69de29 100755 --- a/monitor/static/css/style.css +++ b/monitor/static/css/style.css @@ -1,3 +0,0 @@ -#einsatz{ - -} diff --git a/monitor/templates/monitor/index.html b/monitor/templates/monitor/index.html index 4c2d05b..18ccd03 100755 --- a/monitor/templates/monitor/index.html +++ b/monitor/templates/monitor/index.html @@ -3,101 +3,68 @@ {% block content %} - + -
+

+ {% if alarm is not None %} +
User
+ {% endif %} +
- +{% if alarm is not None %} -