100 lines
3.1 KiB
Plaintext
100 lines
3.1 KiB
Plaintext
|
|
<main class="np-box-container np-open-access">
|
||
|
|
<div class="np-box">
|
||
|
|
{% include "header_minimal" %}
|
||
|
|
<div class="np-box-content-container">
|
||
|
|
<form class="np-form np-box-content" action="{{ form.url }}" method="get" novalidate>
|
||
|
|
{% form_authenticity_token %}
|
||
|
|
<div class="np-form-headline">
|
||
|
|
{% t shared.welcome_to_school, school_name: current_school.name %}
|
||
|
|
</div>
|
||
|
|
<div class="np-form-subheadline">
|
||
|
|
{% t .headline, key: current_school.course_vocabulary %}
|
||
|
|
</div>
|
||
|
|
<div class="np-form-field">
|
||
|
|
<label class="np-input-label" for="learner_first_name">
|
||
|
|
{% t shared.first_name %}
|
||
|
|
</label>
|
||
|
|
<input
|
||
|
|
class="np-input"
|
||
|
|
autofocus="autofocus"
|
||
|
|
type="text"
|
||
|
|
name="first_name"
|
||
|
|
id="learner_first_name"
|
||
|
|
value="{{ form.first_name | escape }}"
|
||
|
|
/>
|
||
|
|
</div>
|
||
|
|
<div class="np-form-field">
|
||
|
|
<label class="np-input-label" for="learner_last_name">
|
||
|
|
{% t shared.last_name %}
|
||
|
|
</label>
|
||
|
|
<input
|
||
|
|
class="np-input"
|
||
|
|
type="text"
|
||
|
|
name="last_name"
|
||
|
|
id="learner_last_name"
|
||
|
|
value="{{ form.last_name | escape }}"
|
||
|
|
/>
|
||
|
|
</div>
|
||
|
|
<div class="np-form-field">
|
||
|
|
<label class="np-input-label" for="learner_email">
|
||
|
|
{% t shared.email_address %}
|
||
|
|
</label>
|
||
|
|
<input
|
||
|
|
class="np-input"
|
||
|
|
type="text"
|
||
|
|
name="email"
|
||
|
|
id="learner_email"
|
||
|
|
value="{{ form.email | escape }}"
|
||
|
|
/>
|
||
|
|
</div>
|
||
|
|
<input
|
||
|
|
type="submit"
|
||
|
|
name="commit"
|
||
|
|
value="{% t shared.enter %}"
|
||
|
|
class="np-button np-button-big np-form-action"
|
||
|
|
/>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</main>
|
||
|
|
<script>
|
||
|
|
|
||
|
|
let submitData = async () => {
|
||
|
|
if(
|
||
|
|
($(".sign-up-follow-up-store-name")[0].value.length > 0) && $(".sign-up-follow-up-city")[0].value.length > 0 && $("#sign-up-state-dropdown")[0].value.length != 0
|
||
|
|
){
|
||
|
|
|
||
|
|
function webhookCaller(){
|
||
|
|
return new Promise(function(res, rej) {
|
||
|
|
let xhr = new XMLHttpRequest();
|
||
|
|
url = "https://webhooks.workato.com/webhooks/rest/4c162498-2fc6-4d3f-b5ea-6b98218b2c39/sign-up-follow-up";
|
||
|
|
|
||
|
|
xhr.addEventListener("load", e => {
|
||
|
|
window.location.replace('/app/waiting-room');
|
||
|
|
//window.location.replace('/app');
|
||
|
|
});
|
||
|
|
xhr.open("POST", url, true);
|
||
|
|
xhr.send(JSON.stringify({
|
||
|
|
email: '{{ current_person.email }}',
|
||
|
|
name: "{{ current_person.first_name }} {{ current_person.last_name }}",
|
||
|
|
user_id: '{{ current_person.id }}',
|
||
|
|
user_city: $(".sign-up-follow-up-city")[0].value,
|
||
|
|
user_state: $("#sign-up-state-dropdown")[0].value,
|
||
|
|
user_store_name: $(".sign-up-follow-up-store-name")[0].value
|
||
|
|
}))
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
try {
|
||
|
|
await webhookCaller()
|
||
|
|
.then((res) => {
|
||
|
|
window.location.replace('/app/dashboard')
|
||
|
|
})
|
||
|
|
} catch(err) {
|
||
|
|
console.log(err)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
</script>
|