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) => { .then(async (resp) => {
const body = resp.text().then((html) => { const body = resp.text().then((html) => {
try { 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`) console.log(`${NAME}: JSON response`)
const status = json.status === 'good' ? 'success' : 'error' const status = json.status === 'good' ? 'success' : 'error'
@ -83,7 +88,7 @@ const formInit = (form) => {
const init = () => { const init = () => {
console.log(`${NAME}: 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) window.addEventListener(`${Events.LODEDANDREADY}`, init)

View File

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

View File

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