1
0
Fork 0

fix: add form padding, validators for /configure pages

This commit is contained in:
Lance Edgar 2024-08-20 19:02:00 -05:00
parent cadd63e3e8
commit e9d59062ca

View file

@ -8,8 +8,10 @@
${self.buttons_content()} ${self.buttons_content()}
${h.form(request.current_route_url(), enctype='multipart/form-data', ref='saveSettingsForm', **{'@submit': 'saveSettingsFormSubmit'})} ${h.form(request.current_route_url(), enctype='multipart/form-data', ref='saveSettingsForm', **{'@submit': 'saveSettingsFormSubmit'})}
${h.csrf_token(request)} ${h.csrf_token(request)}
${self.form_content()} <div class="wutta-form-wrapper">
${self.form_content()}
</div>
${h.end_form()} ${h.end_form()}
<b-modal has-modal-card <b-modal has-modal-card
@ -148,8 +150,18 @@
ThisPageData.settingsNeedSaved = false ThisPageData.settingsNeedSaved = false
ThisPageData.undoChanges = false ThisPageData.undoChanges = false
ThisPageData.savingSettings = false ThisPageData.savingSettings = false
ThisPageData.validators = []
ThisPage.methods.saveSettings = function() { ThisPage.methods.saveSettings = function() {
for (let validator of this.validators) {
let msg = validator.call(this)
if (msg) {
alert(msg)
return
}
}
this.savingSettings = true this.savingSettings = true
this.$refs.saveSettingsForm.submit() this.$refs.saveSettingsForm.submit()
} }