Edit Layout && Add Station select

main
eccDEV 1 year ago
parent e6d6e67d30
commit 720b086292

Binary file not shown.

@ -1,3 +1,17 @@
h1 {
color: red;
#box1 {
text-align: left;
height: auto;
width: 70%;
border-radius: 1rem;
box-shadow: 0rem 0rem 2rem rgb(248, 0, 0);
/* background-color: hsla(0, 100%, 53%, 0.686); */
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-weight: 600;
padding: 2em;
margin-top: 5rem;
margin-left: 17.5%;
}
.fz_activ {
background-color: rgb(255, 61, 61);
color: white;
}

@ -1,33 +0,0 @@
{% load static %}
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<!-- all infos about iphone app -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="JW-ServiceTracker">
<link rel="apple-touch-icon" sizes="167x167" href="{% static 'img/clock.png' %}">
<link rel="apple-touch-icon" sizes="180x180" href="{% static 'img/clock.png' %}">
<!-- all others -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
<link rel="stylesheet" href="{% static 'css/styles.css' %}">
<link rel="stylesheet" href="{% static 'css/create.css' %}">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<title>EmergencyControlCenter - Index</title>
</head>
<body>
{% block pushup %}
{% endblock %}
{% include "main/header.html" %}
{% block content %}
{% endblock %}
</div>
<script src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
</body>
</html>

@ -1,11 +1,64 @@
{% extends 'leitstelle/base.html' %}
{% extends 'main/base.html' %}
{% block content %}
<div class="container-fluid mt-3 text-center">
<h3>Neuer Einsatz</h3>
<h1>test</h1>
</div>
<div id="box1">
<h4 style="color: red; text-transform: uppercase; margin-bottom: 2rem"><b>Einsatzgenerierung</b></h4>
<form action="" method="post">
<div class="row mb-5">
<div class="col-5" style="text-align: left;">
<div id="stichwort">
<h4>Stichwort:</h4>
<select class="form-select" aria-label="Default select example" required>
<option selected value="0">Stichwort wählen...</option>
{% for sw in sw %}
<option value="1">{{sw.1}}</option>
{% endfor %}
</select>
</div>
</div>
<div class="col-2"></div>
<div class="col-5">
<div id="zusatztext">
<h4>Freitext</h4>
<input type="text" class="form-control" name="zusatztext" placeholder="z.B. ROLLER Markt" maxlength="15" required>
</div>
</div>
</div>
<script>
function fzcb(fzid){
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")
}
}
</script>
<h4 style="margin-bottom: 1rem;">Fahrzeuge</h4>
<div class="row mb-5">
{% for fz in fz %}
<div class="col-3" id="fz_{{fz.0}}_div" onclick='fzcb("{{fz.0}}")' style="padding: 1rem; margin-left: 0.5rem; box-shadow: 0 0 1rem gray; border-radius: 1rem; align-items: center; cursor: pointer; text-align:center; margin-bottom:0.5rem;">
{{ fz.3 }} - {{ fz.2 }}
<input type="checkbox" class="d-none" id="fz_{{fz.0}}_cb">
</div>
{% endfor %}
</div>
<input class="btn-danger btn" type="submit" value="AUSLÖSEN">
<a href="/leitstelle/" class="btn btn-secondary">ABBRUCH</a>
</form>
</div>
{% endblock %}

@ -1,16 +1,14 @@
{% extends 'leitstelle/base.html' %}
{% extends 'main/base.html' %}
{% block content %}
<div class="container-fluid row justify-content-center" style="padding: 4rem; margin-top: 5rem;">
<a href="create/" class="col-3 row text-center" style="height: 15vh; align-items: center; border-radius: 1rem; box-shadow: 0rem 0rem 2rem rgb(97, 97, 97);">
<h3>Alarmierung<br>erstellen</h4>
<div class="container-fluid row" style="padding: 4rem; margin-top: 5rem;">
<a href="/leitstelle/create/" class="col-4 offset-2 row" style="height: 10vh; width: auto; align-items: center; border-radius: 1rem; box-shadow: 0rem 0rem 2rem rgb(97, 97, 97); color: white; background-color: red;">
<h4 class="col-5">Alarm Erstellen</h4>
</a>
<!-- <div class="col-1"></div>
<a href="#" class="col-4 row" style="height: 15vh; align-items: center; border-radius: 1rem; box-shadow: 0rem 0rem 2rem rgb(97, 97, 97);">
<span class="col-5 material-symbols-outlined" style="font-size: 7rem;">dashboard</span>
<h4 class="col-5 offset-1">Leitstelle</h4>
<!-- <a href="/leitstelle/wache_setzen/" class="col-4 offset-2 row" style="height: 10vh; width: auto; align-items: center; border-radius: 1rem; box-shadow: 0rem 0rem 2rem rgb(97, 97, 97);">
<h4 class="col-5">Leitstelle Wählen</h4>
</a> -->
</div>

@ -0,0 +1,25 @@
{% extends 'main/base.html' %}
{% block content %}
<div id="box2" style="margin-top:3rem;">
<h4 style="color: red; text-transform: uppercase; margin-bottom: 2rem"><b>Wache wählen</b></h4>
<form action="" method="post">
<div id="stichwort" style="margin-bottom:2rem; width:15rem">
<h4>Feuerwehr:</h4>
<select class="form-select" aria-label="Default select example" required>
<option selected value="0">Feuerwehr wählen...</option>
{% for fw in fw %}
<option value="1">{{fw.1}}</option>
{% endfor %}
</select>
</div>
<input class="btn-danger btn" type="submit" value="AUSLÖSEN">
<a href="/leitstelle/" class="btn btn-secondary">ABBRUCH</a>
</form>
</div>
{% endblock %}

@ -5,4 +5,5 @@ from . import views
urlpatterns = [
path("", views.index, name="leitstelle"),
path("create/", views.create, name="create"),
path("wache_setzen/", views.setStation, name="setStation"),
]

@ -1,8 +1,15 @@
from django.shortcuts import render
from main.models import alarmierung_SW, fahrzeug, leitstelle
# Create your views here.
def index(request):
return render(request, 'leitstelle/index.html')
def create(request):
return render(request, 'leitstelle/create.html')
sw_request = alarmierung_SW.objects.all().values_list()
fz_request = fahrzeug.objects.all().order_by('Funkrufname').values_list()
return render(request, 'leitstelle/create.html', {'sw':sw_request, 'fz':fz_request})
def setStation(request):
feuwehr_request = leitstelle.objects.all().order_by('name').values_list()
return render(request, 'leitstelle/setStation.html', {'fw':feuwehr_request})

@ -1,9 +1,10 @@
from django.contrib import admin
from .models import hours
from .models import *
# Register your models here.
class HoursAdmin(admin.ModelAdmin):
list_display = ("user", "date", "hours", "minutes", "is_ldc", "is_geplant")
admin.site.register(hours, HoursAdmin)
admin.site.register(fahrzeug)
admin.site.register(alarmierung_SW)
admin.site.register(alarmierung)
admin.site.register(feuerwehr)
admin.site.register(leitstelle)

@ -1,11 +1,44 @@
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class hours(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
date = models.DateField(auto_now_add=False)
is_ldc = models.BooleanField(default=False)
is_geplant = models.BooleanField(default=False)
hours = models.IntegerField(auto_created=False, default=0)
minutes = models.IntegerField(auto_created=False, default=0)
# FEUERWEHR
class feuerwehr(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
return self.name
# FAHRZEUGE
class fahrzeug(models.Model):
fw = models.ForeignKey(feuerwehr, on_delete=models.CASCADE, name="Standort", null=True)
kürzel = models.CharField(max_length=50, name="kürzel", default="")
fn = models.CharField(max_length=20, name="Funkrufname", default="")
def __str__(self):
return self.Standort.name + " -- " + str(self.Funkrufname) + " -- " + str(self.kürzel)
# STICHWORT
class alarmierung_SW(models.Model):
kürzel = models.CharField(max_length=20)
beschreibung = models.CharField(max_length=50)
def __str__(self):
return self.kürzel + " -- " + str(self.beschreibung)
# ALARMIERUNG
class alarmierung(models.Model):
timestamp = models.DateTimeField(auto_created=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)
fw = models.ForeignKey(feuerwehr, on_delete=models.CASCADE, name="Standort")
def __str__(self):
return str(self.timestamp) + " -- " + str(self.Stichwort.kürzel) + " -- " + str(self.ft) + " -- " + str(self.fz) + " -- " + str(self.Standort.name)
class leitstelle(models.Model):
name = models.CharField(max_length=50)
fw = models.CharField(max_length=150)
def __str__(self):
return self.name

@ -13,6 +13,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
<link rel="stylesheet" href="{% static 'css/styles.css' %}">
<link rel="stylesheet" href="{% static 'css/create.css' %}">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<title>EmergencyControlCenter - Index</title>
</head>

@ -1,7 +1,7 @@
{% load static %}
<div class="container">
<div class="top_line row justify-content-between">
<div class="title col-6 text-start dropdown">
<div class="title col-1 text-start dropdown">
<span class="curser" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
<!-- <h4><c style="color: rgb(168, 168, 168); vertical-align: top;" id="dropdownMenuLink" data-bs-toggle="dropdown"><c style="color: rgb(200, 69, 69)">Emergency</c>ControlCenter</h4> -->
<h4><c style="color: rgb(168, 168, 168); vertical-align: top;"><c style="color: rgb(200, 69, 69)">Emergency</c>ControlCenter</h4>

@ -4,14 +4,14 @@
{% block content %}
<div class="container-fluid row" style="padding: 4rem; margin-top: 5rem;">
<a href="/monitor/" class="col-4 offset-2 row" style="height: 15vh; align-items: center; border-radius: 1rem; box-shadow: 0rem 0rem 2rem rgb(97, 97, 97);">
<span class="col-5 material-symbols-outlined" style="font-size: 7rem;">tv</span>
<h4 class="col-5 offset-1">Monitor</h4>
<a href="/monitor/" class="col-4 offset-2 row" style="height: 10vh; width: auto; align-items: center; border-radius: 1rem; box-shadow: 0rem 0rem 2rem rgb(97, 97, 97);">
{% comment %} <span class="col-3 material-symbols-outlined" style="font-size: clamp(1rem, 5vw, 10rem);">tv</span> {% endcomment %}
<h4 class="col-5">Monitor</h4>
</a>
<div class="col-1"></div>
<a href="/leitstelle/" class="col-4 row" style="height: 15vh; align-items: center; border-radius: 1rem; box-shadow: 0rem 0rem 2rem rgb(97, 97, 97);">
<span class="col-5 material-symbols-outlined" style="font-size: 7rem;">dashboard</span>
<h4 class="col-5 offset-1">Leitstelle</h4>
<a href="/leitstelle/" class="col-4 row" style="height: 10vh; width: auto; align-items: center; border-radius: 1rem; box-shadow: 0rem 0rem 2rem rgb(97, 97, 97);">
{% comment %} <span class="col-3 material-symbols-outlined" style="font-size: clamp(1rem, 5vw, 10rem);">dashboard</span> {% endcomment %}
<h4 class="col-5">Leitstelle</h4>
</a>
</div>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -3,13 +3,101 @@
{% block content %}
<style>
#einsatz{
margin: 3%;
text-align: center;
border-width: 1px;
border-color: black;
border-style: solid;
}
#einsatz h1{
font-weight: bolder;
animation-duration: 1s;
animation-name: alarmh1;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
@keyframes alarmh1 {
from {color: red;}
to {color: black;}
}
</style>
<div class="container-fluid row justify-content-start" style="padding: 0rem; margin-top: 2rem;" onload="startTime()">
<div class="col-4 text-center row" style="height: 15vh; align-items: center; border-radius: 1rem; box-shadow: 0rem 0rem 2rem rgb(97, 97, 97);">
<h1 id="date-time" style="font-size: 4rem;"></h1>
<h1 id="date-time" style="font-size: clamp(1rem, 5vw, 10rem); text-align: center;"></h1>
</div>
</div>
<button onclick="einsatzalarmfunktion(); playsound1()" style="position: absolute; bottom: 40px; left: 40px;">Klick mich hart!</button>
<div id="einsatz" style="visibility: hidden;">
<h1>ALARM</h1>
Inhalt Alarm
</div>
<script src="{% static 'js/clock.js' %}" type="text/javascript"></script>
<script>
function einsatzalarmfunktion() {
var x = document.getElementById("einsatz");
if (x.style.visibility === "hidden") {
x.style.visibility = "visible";
} else {
x.style.visibility = "hidden";
}
}
</script>
<script type="text/javascript">
// -- funktion um eine Audiodatei abzuspielen
function playsound2(){
var audio = new Audio('audio1.mp3')
audio.play();
}
// -- repeat -> anzahl der audiodateien
// -- playlist -> name & reihenfolge audio dateien
var
a1 = new Audio("static/sounds/audio1.mp3"),
a2 = new Audio("audio2.mp3"),
a3 = new Audio("audio3.mp3"),
a4 = new Audio("audio2.mp3"),
a5 = new Audio("audio5.mp3"),
a6 = new Audio("audio6.mp3"),
playlist = [a6, a1, a2, a5],
current = null,
idx = 0;
repeat = 4;
function playsound1() {
if (current === null || current.ended) {
// go to next
current = playlist[idx++];
// check if is the last of playlist and return to first
if (idx >= playlist.length)
idx = 0;
// play
current.play();
repeat--;
}
if (repeat != 0) {
setTimeout(playsound1, 100);
}
}
//Playlist mit Javascript https://www.webcodegeeks.com/html5/html5-audio-player-example/
</script>
{% endblock %}
Loading…
Cancel
Save

Powered by TurnKey Linux.