Kontakt-Popup wird zum Testzugang-Formular, nur noch ein Knopf
Im Kontakt-Abschnitt steht nur noch "Testzugang anfragen" und oeffnet das Popup. Darin liegt jetzt das Testzugang-Formular ohne die Frage nach dem Thema, also Name, Behoerde, Funktion, Telefon, dienstliche E-Mail und Nutzerzahl. Die Freemail-Sperre und die Erkennung von Behoerdendomains greifen dort genauso wie auf der Seite. Wer zuerst eine Frage hat, findet unter dem Knopf einen direkten Mail-Hinweis. Das alte submitContact in app.js entfaellt, beide Formulare laufen ueber js/trial-form.js. Die gemeinsamen Formular-Styles liegen jetzt in css/style.css statt doppelt in den Seiten.
Dieser Commit ist enthalten in:
40
js/app.js
40
js/app.js
@@ -646,44 +646,8 @@ function mdToHtml(md) {
|
||||
}
|
||||
});
|
||||
|
||||
// Form submit -> server-side SMTP
|
||||
window.submitContact = function (e) {
|
||||
e.preventDefault();
|
||||
var lang = (document.documentElement.lang || 'de').toLowerCase().indexOf('en') === 0 ? 'en' : 'de';
|
||||
var T = lang === 'en'
|
||||
? { sending: 'Sending...', send: 'Send message', sendError: 'Error sending message', netError: 'Connection error. Please try again.' }
|
||||
: { sending: 'Wird gesendet...', send: 'Nachricht senden', sendError: 'Fehler beim Senden', netError: 'Verbindungsfehler. Bitte versuchen Sie es erneut.' };
|
||||
var btn = e.target.querySelector('button[type="submit"]');
|
||||
if (btn) { btn.disabled = true; btn.textContent = T.sending; }
|
||||
|
||||
fetch('/api/contact', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
name: document.getElementById('cf-name').value,
|
||||
organisation: document.getElementById('cf-org').value,
|
||||
email: document.getElementById('cf-email').value,
|
||||
message: document.getElementById('cf-message').value,
|
||||
lang: lang
|
||||
})
|
||||
})
|
||||
.then(function (r) { return r.json().then(function (d) { return { ok: r.ok, data: d }; }); })
|
||||
.then(function (res) {
|
||||
if (res.ok) {
|
||||
document.getElementById('contact-form').style.display = 'none';
|
||||
document.getElementById('form-success').style.display = 'block';
|
||||
if (window.umami) umami.track('contact_form_success');
|
||||
} else {
|
||||
alert(res.data.error || T.sendError);
|
||||
if (btn) { btn.disabled = false; btn.textContent = T.send; }
|
||||
}
|
||||
})
|
||||
.catch(function () {
|
||||
alert(T.netError);
|
||||
if (btn) { btn.disabled = false; btn.textContent = T.send; }
|
||||
});
|
||||
return false;
|
||||
};
|
||||
/* Der Versand des Modal-Formulars liegt seit dem Umbau auf Testzugang
|
||||
in js/trial-form.js, gemeinsam mit der Seite /testzugang/. */
|
||||
|
||||
/* ==================== LOAD DEEPFAKES DATA ==================== */
|
||||
function loadDeepfakesData() {
|
||||
|
||||
@@ -198,21 +198,21 @@
|
||||
|
||||
var L = T.labels;
|
||||
var e_ = L.empty;
|
||||
var body = [
|
||||
var zeilen = [
|
||||
L.head,
|
||||
'',
|
||||
L.org + ' = ' + (val('tf-org') || e_),
|
||||
L.role + ' = ' + (val('tf-role') || e_),
|
||||
L.mail + ' = ' + email,
|
||||
L.phone + ' = ' + (val('tf-phone') || e_),
|
||||
L.users + ' = ' + (val('tf-users') || e_),
|
||||
L.start + ' = ' + (val('tf-start') || e_),
|
||||
'',
|
||||
L.topic,
|
||||
val('tf-topic') || e_,
|
||||
'',
|
||||
L.domain + ' = ' + (looksOfficial(email) ? L.domainOk : L.domainCheck)
|
||||
].join('\n');
|
||||
L.users + ' = ' + (val('tf-users') || e_)
|
||||
];
|
||||
/* Startwunsch und Themenfeld gibt es nur auf der Testzugang-Seite,
|
||||
im Modal der Startseite fehlen sie bewusst. */
|
||||
if (document.getElementById('tf-start')) zeilen.push(L.start + ' = ' + (val('tf-start') || e_));
|
||||
if (document.getElementById('tf-topic')) zeilen.push('', L.topic, val('tf-topic') || e_);
|
||||
zeilen.push('', L.domain + ' = ' + (looksOfficial(email) ? L.domainOk : L.domainCheck));
|
||||
var body = zeilen.join('\n');
|
||||
|
||||
fetch('/api/contact', {
|
||||
method: 'POST',
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren