2016-05-09 18:16:54 -04:00
|
|
|
extends /templates/core/modal-base-flat
|
|
|
|
|
2016-06-17 18:40:03 -04:00
|
|
|
//- TODO: i18n
|
|
|
|
|
2016-05-09 18:16:54 -04:00
|
|
|
block modal-header-content
|
|
|
|
.text-center
|
|
|
|
h3 Contact Our Classroom Team
|
|
|
|
|
|
|
|
block modal-body-content
|
|
|
|
p Send us a message and our classroom success team will be in touch to help find the best solution for your students' needs!
|
|
|
|
form
|
2016-05-23 13:26:34 -04:00
|
|
|
- var sending = view.state.get('sendingState') === 'sending'
|
|
|
|
- var sent = view.state.get('sendingState') === 'sent';
|
2016-05-09 18:16:54 -04:00
|
|
|
- var values = view.state.get('formValues');
|
|
|
|
- var errors = view.state.get('formErrors');
|
2016-06-17 18:40:03 -04:00
|
|
|
|
|
|
|
.form-group(class=errors.name ? 'has-error' : '')
|
|
|
|
label.control-label(for="name" data-i18n="general.name")
|
|
|
|
+formErrors(errors.name)
|
|
|
|
input.form-control(name="name", type="text", value=values.name || '', tabindex=1, disabled=sending || sent)
|
|
|
|
|
2016-05-09 18:16:54 -04:00
|
|
|
.form-group(class=errors.email ? 'has-error' : '')
|
|
|
|
label.control-label(for="email" data-i18n="general.email")
|
|
|
|
+formErrors(errors.email)
|
2016-05-23 13:26:34 -04:00
|
|
|
input.form-control(name="email", type="email", value=values.email || '', tabindex=1, disabled=sending || sent)
|
2016-06-17 18:40:03 -04:00
|
|
|
|
|
|
|
.form-group(class=errors.licensesNeeded ? 'has-error' : '')
|
|
|
|
label.control-label(for="licensesNeeded" data-i18n="teachers.licenses_needed")
|
|
|
|
+formErrors(errors.licensesNeeded)
|
|
|
|
input.form-control(name="licensesNeeded", type="text", value=values.licensesNeeded || '', tabindex=1, disabled=sending || sent)
|
|
|
|
|
2016-05-09 18:16:54 -04:00
|
|
|
.form-group(class=errors.message ? 'has-error' : '')
|
|
|
|
label.control-label(for="message" data-i18n="general.message")
|
|
|
|
+formErrors(errors.message)
|
2016-05-23 13:26:34 -04:00
|
|
|
textarea.form-control(name="message", tabindex=1 disabled=sending || sent)= values.message
|
2016-06-17 18:40:03 -04:00
|
|
|
|
2016-05-09 18:16:54 -04:00
|
|
|
if view.state.get('sendingState') === 'error'
|
|
|
|
.alert.alert-danger Could not send message.
|
2016-06-17 18:40:03 -04:00
|
|
|
|
2016-05-23 13:26:34 -04:00
|
|
|
if sent
|
2016-05-09 18:16:54 -04:00
|
|
|
.alert.alert-success Message sent!
|
2016-06-17 18:40:03 -04:00
|
|
|
|
2016-05-09 18:16:54 -04:00
|
|
|
.text-right
|
|
|
|
button#submit-btn.btn.btn-navy.btn-lg(type='submit' disabled=sending || sent) Submit
|
2016-06-17 18:40:03 -04:00
|
|
|
|
2016-05-09 18:16:54 -04:00
|
|
|
block modal-footer
|
|
|
|
|
|
|
|
mixin formErrors(errors)
|
|
|
|
if _.isString(errors)
|
|
|
|
- errors = [errors]
|
|
|
|
if _.size(errors)
|
|
|
|
.help-block
|
|
|
|
for error in errors
|
|
|
|
div= error
|