IMPR: Minor form updates

This commit is contained in:
Tony Air 2024-02-02 16:31:10 +02:00
parent d1c6bcc8bf
commit eeab0fceb3
3 changed files with 16 additions and 2 deletions

View File

@ -33,7 +33,12 @@ const submitForm = (e) => {
.then(async (resp) => {
const body = resp.text().then((html) => {
try {
const json = JSON.parse(html)
let json = JSON.parse(html)
if (typeof json.MainContent !== undefined) {
json = JSON.parse(json.MainContent)
}
console.log(`${NAME}: JSON response`)
const status = json.status === 'good' ? 'success' : 'error'
@ -83,7 +88,7 @@ const formInit = (form) => {
const init = () => {
console.log(`${NAME}: init`)
document.querySelectorAll('#MainContent form:not(.legacy)').forEach(formInit)
document.querySelectorAll('#MainContent form:not(.legacy),.ajax-form').forEach(formInit)
}
window.addEventListener(`${Events.LODEDANDREADY}`, init)

View File

@ -38,6 +38,10 @@
}
}
.form__field input.password {
@extend .form-control;
}
.form__fieldset {
margin-bottom: -1rem;
}

View File

@ -6,6 +6,7 @@
.alert {
display: flex;
margin-bottom: 0;
.alert__container {
display: flex;
}
@ -27,3 +28,7 @@
display: flex !important;
}
}
.alert-bad {
@extend .alert-danger;
}