Glassdoor notes, some Mizuno templates & a script
This commit is contained in:
@ -1,19 +1,3 @@
|
||||
{% assign groupValidator = false %}
|
||||
{% for group in current_person.groups %}
|
||||
{% if group %}
|
||||
{% assign groupValidator = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if current_person.signed_in? %}
|
||||
{% if groupValidator == true %}
|
||||
<script>
|
||||
if (window.location.pathname != '/app/dashboard'){
|
||||
window.location.replace('/app/dashboard');
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class="sign-up-follow-up-container" onload="">
|
||||
<div class="sign-up-follow-up-content">
|
||||
@ -23,19 +7,20 @@
|
||||
class="sign-up-follow-up-image sign-up-school-logo"
|
||||
src="{{ current_school.logo_url }}"
|
||||
/>
|
||||
<h1 class="sign-up-follow-up-prompt">Please select the Territory Manager that is responsible for your Mizuno Golf account below: </h1>
|
||||
<h1 class="sign-up-follow-up-prompt">Please enter your city and store name and select your state from the dropdown below: </h1>
|
||||
|
||||
{% include "sign-up-follow-up-dropdown" %}
|
||||
<input class="sign-up-follow-up-input sign-up-follow-up-store-name" placeholder="Store Name"/>
|
||||
|
||||
<img
|
||||
<input class="sign-up-follow-up-input sign-up-follow-up-city" placeholder="City"/>
|
||||
|
||||
{% include "sign_up_follow_up_dropdown" %}
|
||||
{%- comment -%} <img
|
||||
alt="sign-up-pga-logo"
|
||||
class="sign-up-follow-up-image"
|
||||
src="https://s3.amazonaws.com/static.northpass.com/Mizuno+Golf/Mizuno_follow_up_image.png"
|
||||
/>
|
||||
<h1 class="sign-up-follow-up-prompt">Upon completion of Mizuno Product and Fitting Knowledge Courses, PGA Members are eligible to receive PDR credits. If you are a PGA Member, please enter your member number below:</h1>
|
||||
/> {%- endcomment -%}
|
||||
{%- comment -%} <h1 class="sign-up-follow-up-prompt">Please enter your store name below:</h1> {%- endcomment -%}
|
||||
|
||||
|
||||
<input class="sign-up-follow-up-input" placeholder="PGA Member Number"/>
|
||||
<button class="sign-up-follow-up-button" onclick="submitData()">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -54,7 +39,7 @@
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 3rem 0;
|
||||
margin: 1rem 0;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
@ -78,6 +63,7 @@
|
||||
|
||||
.sign-up-dropdown{
|
||||
height: 55px;
|
||||
padding-left: 28px;
|
||||
}
|
||||
|
||||
.sign-up-follow-up-input{
|
||||
@ -102,9 +88,10 @@
|
||||
}
|
||||
|
||||
.sign-up-follow-up-prompt{
|
||||
font-size: 2rem;
|
||||
margin: 3.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
font-size: 1.75rem;
|
||||
margin: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
max-width: 60%;
|
||||
}
|
||||
|
||||
.sign-up-dropdown,
|
||||
@ -123,25 +110,11 @@
|
||||
</style>
|
||||
|
||||
<script>
|
||||
/* INPUT AND SUBMIT VALIDATORS */
|
||||
let digits = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
||||
let onlyDigits;
|
||||
|
||||
let checkIfInputsExist = () => {
|
||||
window.setTimeout(function(){
|
||||
let validationStr = $(".sign-up-follow-up-input")[0].value.split("");
|
||||
onlyDigits = true;
|
||||
|
||||
for(let i = 0; i < validationStr.length; i++){
|
||||
if(digits.indexOf(validationStr[i]) < 0){
|
||||
onlyDigits = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(
|
||||
(($(".sign-up-follow-up-input")[0].value.length >= 8 && $(".sign-up-follow-up-input")[0].value.length <= 9 && onlyDigits == true)
|
||||
|| $(".sign-up-follow-up-input")[0].value.length == 0)
|
||||
&& $("#sign-up-group-dropdown")[0].value.length != 0
|
||||
($(".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
|
||||
){
|
||||
$(".sign-up-follow-up-button").css("background-color","#001588");
|
||||
$(".sign-up-follow-up-button").css("color","#FFFFFF");
|
||||
@ -156,42 +129,33 @@
|
||||
}, 500)
|
||||
}
|
||||
document.addEventListener('keydown', checkIfInputsExist);
|
||||
document.getElementsByClassName("sign-up-follow-up-input")[0].addEventListener('change', checkIfInputsExist);
|
||||
document.getElementById("sign-up-group-dropdown").addEventListener('change', checkIfInputsExist);
|
||||
document.getElementsByClassName("sign-up-follow-up-store-name")[0].addEventListener('change', checkIfInputsExist);
|
||||
document.getElementsByClassName("sign-up-follow-up-city")[0].addEventListener('change', checkIfInputsExist);
|
||||
document.getElementById("sign-up-state-dropdown").addEventListener('change', checkIfInputsExist);
|
||||
|
||||
let submitData = async () => {
|
||||
if(
|
||||
(($(".sign-up-follow-up-input")[0].value.length >= 8 && $(".sign-up-follow-up-input")[0].value.length <= 9 && onlyDigits == true)
|
||||
|| $(".sign-up-follow-up-input")[0].value.length == 0)
|
||||
&& $("#sign-up-group-dropdown")[0].value.length != 0
|
||||
){
|
||||
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://www.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/pga-id-submit";
|
||||
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);
|
||||
if($(".sign-up-follow-up-input")[0].value.length == 0){
|
||||
xhr.send(JSON.stringify({
|
||||
email: '{{ current_person.email }}',
|
||||
name: "{{ current_person.first_name }} {{ current_person.last_name }}",
|
||||
user_id: '{{ current_person.id }}',
|
||||
user_group: $("#sign-up-group-dropdown")[0].value
|
||||
}))
|
||||
} else {
|
||||
xhr.send(JSON.stringify({
|
||||
email: '{{ current_person.email }}',
|
||||
name: "{{ current_person.first_name }} {{ current_person.last_name }}",
|
||||
pga_id: $(".sign-up-follow-up-input")[0].value,
|
||||
user_id: '{{ current_person.id }}',
|
||||
user_group: $("#sign-up-group-dropdown")[0].value
|
||||
}))
|
||||
}
|
||||
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
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user