From 9e68f87240526564b68fb85dfb7ff7fc7f0599fe Mon Sep 17 00:00:00 2001 From: Mikhail Bortnikov Date: Thu, 13 Jul 2017 15:31:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D0=B3=D0=B0=D0=BB=D0=BE=D1=87?= =?UTF-8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/apis/access.js | 9 +++++++++ static/js/apis/activation.js | 31 +++++++++++++++++++------------ templates/activation.html | 5 ++++- templates/no_auth_modals.html | 5 ++++- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/static/js/apis/access.js b/static/js/apis/access.js index bbafc7d..f511241 100755 --- a/static/js/apis/access.js +++ b/static/js/apis/access.js @@ -95,9 +95,17 @@ function forgot(){ }) } function registry_go(){ + if ($('#checkBox').prop('checked') != true){ + console.log('NOT PASS') + $('#error_registration').html('Перед регистрацией ознакомтесь с договором-оферты'); + $('#error_registration').fadeIn('fast'); + + } else { + console.log('PASS') $('#error_registration').html(''); $('#error_registration').fadeIn('fast'); var theForm = $(document.forms['registration_form']).serialize(); + console.log(theForm) $.ajax({ type: 'POST', url: '/access/registration/', @@ -120,6 +128,7 @@ function registry_go(){ console.log('Возникла ошибка registry_go(): ' + str); } }); + } } function registry_go2(){ diff --git a/static/js/apis/activation.js b/static/js/apis/activation.js index 6edb105..cafe099 100755 --- a/static/js/apis/activation.js +++ b/static/js/apis/activation.js @@ -28,20 +28,27 @@ function sent_step(step){ return result; } function check_step(step){ - // Проверка данных этапа - > Отправка данных - var result = sent_step(step); - if (result[0]){ - if (step==3){ - final_button() - } - close_step(step); - enable_step(step+1); + if ($('#checkBox').prop('checked') != true){ + console.log('NOT PASS') + $('[name="error"]').html('Перед регистрацией ознакомтесь с договором-оферты'); + $('#error_registration').fadeIn('fast'); + } else { - visible_error(step, result[1]['inputs'], result[1]['message']) + // Проверка данных этапа - > Отправка данных + var result = sent_step(step); + if (result[0]){ + if (step==3){ + final_button() + } + close_step(step); + enable_step(step+1); + } else { + visible_error(step, result[1]['inputs'], result[1]['message']) + } + // Если все верно - > Переход на новый уровень + // Если нет - > Подсвечивание полей + //console.log('Получил запрос этапа '+step) } - // Если все верно - > Переход на новый уровень - // Если нет - > Подсвечивание полей - //console.log('Получил запрос этапа '+step) } function enable_step(step){ // Активация этапа diff --git a/templates/activation.html b/templates/activation.html index 0cd3bc5..b29db2d 100755 --- a/templates/activation.html +++ b/templates/activation.html @@ -301,7 +301,10 @@ - Регистрируясь, вы соглашаетесь с договором-оферты +
+ + Регистрируясь, вы соглашаетесь с договором-оферты +

{% now "Y" %} {{ NAME }} diff --git a/templates/no_auth_modals.html b/templates/no_auth_modals.html index aca2443..d6375b1 100755 --- a/templates/no_auth_modals.html +++ b/templates/no_auth_modals.html @@ -18,7 +18,10 @@

- Регистрируясь, вы соглашаетесь с договором-оферты +

+ + Регистрируясь, вы соглашаетесь с договором-оферты +
Я уже зарегистрирован