mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#4885 Sms verification will come at register page
This commit is contained in:
parent
fa68c4f9b2
commit
5b1eb81c66
@ -19,24 +19,33 @@ phoneInput.on('keydown', function () {
|
||||
clearTimeout(typingTimer);
|
||||
});
|
||||
|
||||
function doneTyping(phoneNum) {
|
||||
function getPhoneNumber(phoneNum) {
|
||||
if (!phoneNum.includes('_') && phoneNum !== "") {
|
||||
let countryCode = $(".iti__selected-flag").attr('title').split("+");
|
||||
countryCode = '+' + countryCode[countryCode.length - 1];
|
||||
return countryCode + phoneNum.substr(1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function doneTyping(phoneNum) {
|
||||
var phone = getPhoneNumber(phoneNum);
|
||||
if (phone) {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
data: {'phoneNumber': countryCode + phoneNum.substr(1)},
|
||||
data: {'phoneNumber': phone },
|
||||
url: 'ajax/phone-validation',
|
||||
success: function (response) {
|
||||
if (response.userExists) {
|
||||
phoneInput.addClass('rejected-phone');
|
||||
phoneInput.removeClass('approved-phone');
|
||||
$('.phone-validation-error').removeClass('d-none')
|
||||
$('.verify-button').addClass('d-none')
|
||||
} else {
|
||||
phoneInput.addClass('approved-phone');
|
||||
phoneInput.removeClass('rejected-phone');
|
||||
$('.phone-validation-error').addClass('d-none')
|
||||
$('.phone-validation-error').addClass('d-none');
|
||||
$('.verify-button').removeClass('d-none');
|
||||
}
|
||||
},
|
||||
});
|
||||
@ -45,4 +54,4 @@ function doneTyping(phoneNum) {
|
||||
phoneInput.removeClass('rejected-phone');
|
||||
$('.phone-validation-error').addClass('d-none')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,9 +54,10 @@
|
||||
<span class="required">*</span>
|
||||
</label>
|
||||
|
||||
<div class="input-wrapper validate-phone">
|
||||
<div class="input-wrapper validate-phone d-flex">
|
||||
{{ form.fields.phone.setAttributes({'maxlength': 15}).setValue(form.fields.phone.value).input|raw }}
|
||||
<div id="default-phone-country" class="hidden">{{ setting_value('visiosoft.module.location::country_for_phone_field') }}</div>
|
||||
{{ addBlock('register/activation')|raw }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -78,4 +79,4 @@
|
||||
{{ form.fields.password.setPlaceholder(trans('visiosoft.theme.base::field.password')).input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
|
||||
<div class="col-12 row m-0">
|
||||
<div class="col-6 pr-0 pl-1">
|
||||
<button class="btn btn-sm btn-success py-2">
|
||||
<button class="btn btn-sm btn-success py-2 register-button">
|
||||
<i class="fas fa-user-plus"></i>
|
||||
{{ trans('visiosoft.theme.base::button.register') }}
|
||||
</button>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user