update Do 6. Feb 17:01:01 CET 2020

This commit is contained in:
Robert Richter 2020-02-06 17:01:01 +01:00
parent 8eaf7d0991
commit 371a3c66e3
6 changed files with 35 additions and 19 deletions

View File

@ -10,6 +10,7 @@
- Absturz bei unbekannter/falscher Wachennummer in Alarmmonitor-URL - Absturz bei unbekannter/falscher Wachennummer in Alarmmonitor-URL
- openstreetmap credit - openstreetmap credit
- name, leitstelle, version immer mitgeben - name, leitstelle, version immer mitgeben
- Eingaben auf validität prüfen
## 2. Priorität (notwendige Anpassungen) ## 2. Priorität (notwendige Anpassungen)

View File

@ -64,6 +64,19 @@ module.exports = function(app, sql, app_cfg, passport, auth, udp) {
}); });
}); });
app.post('/rueckmeldung/:waip_uuid', function(req, res) {
sql.db_save_response(waip_id, responseobj, function(result){
if (result) {
res.redirect('/rueckmeldung/' + req.params.waip_uuid);
} else {
var err = new Error('Fehler beim senden der Rückmeldung!');
err.status = 500;
next(err);
};
});
res.redirect('/rueckmeldung/:waip_uuid');
});
// get /config // get /config
app.get('/config', auth.ensureAuthenticated, function(req, res) { app.get('/config', auth.ensureAuthenticated, function(req, res) {
sql.db_get_userconfig(req.user.id, function(data) { sql.db_get_userconfig(req.user.id, function(data) {

View File

@ -611,7 +611,7 @@ module.exports = function(db, async, app_cfg) {
\'` + waip_id + `\', \'` + waip_id + `\',
\'` + responseobj + `\')`), function(err) { \'` + responseobj + `\')`), function(err) {
if (err == null) { if (err == null) {
callback && callback(); callback && callback('OK');
} else { } else {
callback && callback(null); callback && callback(null);
}; };
@ -685,7 +685,7 @@ module.exports = function(db, async, app_cfg) {
if (err == null && rows) { if (err == null && rows) {
var einsatzdaten = row; var einsatzdaten = row;
einsatzdaten.einsatzmittel = rows; einsatzdaten.einsatzmittel = rows;
db.all(`SELECT DISTINCT e.wachenname FROM waip_einsatzmittel e db.all(`SELECT DISTINCT e.waip_wachen_ID, e.wachenname FROM waip_einsatzmittel e
WHERE e.waip_einsaetze_id = ?`, [row.id], function(err, wachen) { WHERE e.waip_einsaetze_id = ?`, [row.id], function(err, wachen) {
if (err == null && wachen) { if (err == null && wachen) {
einsatzdaten.wachen = wachen; einsatzdaten.wachen = wachen;

View File

@ -7,8 +7,9 @@
button.close(type='button', data-dismiss='modal', aria-label='Close') button.close(type='button', data-dismiss='modal', aria-label='Close')
span(aria-hidden='true') × span(aria-hidden='true') ×
#responseModalBody.modal-body #responseModalBody.modal-body
p.text-muted Ich komme als ... form#send_response(action="/rueckmeldung", method="POST")
.form-group .form-group
p.text-muted Ich komme als ...
.custom-control.custom-radio.form-control-lg .custom-control.custom-radio.form-control-lg
input#radios_res_ek.custom-control-input(type='radio', name='radios_res', value='1') input#radios_res_ek.custom-control-input(type='radio', name='radios_res', value='1')
label.custom-control-label(for='radios_res_ek') label.custom-control-label(for='radios_res_ek')
@ -28,22 +29,22 @@
label.custom-control-label.text-warning(for='cb_res_agt') label.custom-control-label.text-warning(for='cb_res_agt')
| und bin Atemschutzgeräteträger! | und bin Atemschutzgeräteträger!
div.border-top.my-3 div.border-top.my-3
p.text-muted in ungefähr ...
.form-group .form-group
label(for='eintreffzeit').text-muted in ungefähr ...
select#eintreffzeit.form-control.form-control-lg select#eintreffzeit.form-control.form-control-lg
option(value=null) bitte Eintreffzeit wählen option(value=null) bitte Eintreffzeit wählen
option(value='5') 5 Minuten option(value='5') 5 Minuten
option(value='10') 10 Minuten option(value='10') 10 Minuten
option(value='15') 15 Minuten option(value='15') 15 Minuten
option(value='20') 20 Minuten option(value='20') 20 Minuten
p.text-muted zur Wache ...
.form-group .form-group
label(for='wachenauswahl').text-muted zur Wache ...
select#wachenauswahl.form-control.form-control-lg select#wachenauswahl.form-control.form-control-lg
option(value=null) bitte Wache wählen option(value=null) bitte Wache wählen
each val in einsatzdaten.wachen each val in einsatzdaten.wachen
option(value='#{val.wachenname}') #{val.wachenname} option(value='#{val.waip_wachen_ID}') #{val.wachenname}
//option(value='2') CB FW Cottbus 3 //option(value='2') CB FW Cottbus 3
//option(value='3') CB FW Madlow //option(value='3') CB FW Madlow
//option(value='4') CB FW Kieckebusch //option(value='4') CB FW Kieckebusch
.modal-footer .modal-footer
button#send_response.btn.btn-lg.btn-block.btn-warning.btn-outline-primary.ion-md-paper-plane(type='button', data-dismiss='modal') Rückmeldung absenden! button.btn.btn-lg.btn-block.btn-warning.btn-outline-primary.p-3.ion-md-paper-plane(type='submit', form="send_response", value='submit') Rückmeldung absenden!

View File

@ -68,13 +68,13 @@
div.pr-2 #{val.einsatzmittel} div.pr-2 #{val.einsatzmittel}
unless val.status == null unless val.status == null
case val.status case val.status
when 1 when '1'
div.p-2.badge.badge-info #{val.status} div.p-2.badge.badge-info #{val.status}
when 2 when '2'
div.p-2.badge.badge-success #{val.status} div.p-2.badge.badge-success #{val.status}
when 3 when '3'
div.p-2.badge.badge-warning #{val.status} div.p-2.badge.badge-warning #{val.status}
when 4 when '4'
div.p-2.badge.badge-danger #{val.status} div.p-2.badge.badge-danger #{val.status}
default default
div.p-2.badge.badge-dark #{val.status} div.p-2.badge.badge-dark #{val.status}

View File

@ -9,7 +9,8 @@ block content
.col-12 .col-12
ol ol
each val in dataSet each val in dataSet
li= val.einsatzart + ', ' + val.stichwort + ', ' + val.ort + ' ' + val.ortsteil + ' (' + val.uuid + ')' li= val.einsatzart + ', ' + val.stichwort + ', ' + val.ort + ' ' + val.ortsteil
a(href="/rueckmeldung/" + val.uuid)= val.uuid
ul ul
if val.a if val.a
each val_a in (val.a).split(",") each val_a in (val.a).split(",")