diff --git a/lms/urls.py b/lms/urls.py index 85f4d58..a1ad487 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -6,8 +6,10 @@ from lms import views from lms import settings from access.views import profile_view + urlpatterns = [ url(r'^$', views.index), + url(r'^oferta/', views.show_oferta), url(r'^test/$', views.test), url(r'^all_comments/$', views.all_comments), url(r'^reports/$', views.new_reports), diff --git a/lms/views.py b/lms/views.py index d7dff34..41f3d5b 100644 --- a/lms/views.py +++ b/lms/views.py @@ -10,7 +10,7 @@ from finance.models import Bill from courses.templates import comment_fabric from library.models import Article from management.reports import get_now_success_hw, get_second_success_hw - +from django.http import HttpResponse def sortByTimeStamp(inputStr): return inputStr['sort'] @@ -154,3 +154,9 @@ def new_reports(request): @response_decor(template='contacts.html', without_auth=True) def contacts(request): return {} + +def show_oferta(request): + with open('oferta.pdf', 'rb') as pdf: + response = HttpResponse(pdf.read(), content_type='application/pdf') + response['Content-Disposition'] = 'filename=oferta.pdf' + return response \ No newline at end of file diff --git a/oferta.pdf b/oferta.pdf new file mode 100644 index 0000000..0f10852 Binary files /dev/null and b/oferta.pdf differ 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 9b564ce..b29db2d 100755 --- a/templates/activation.html +++ b/templates/activation.html @@ -301,6 +301,10 @@ +
{% now "Y" %}
{{ NAME }}
diff --git a/templates/no_auth_modals.html b/templates/no_auth_modals.html
index 5d1c19b..d6375b1 100755
--- a/templates/no_auth_modals.html
+++ b/templates/no_auth_modals.html
@@ -18,6 +18,10 @@
+