diff --git a/apps/school/templates/blocks/day_pay_btn.html b/apps/school/templates/blocks/day_pay_btn.html
index 155b8827..f4cd2f40 100644
--- a/apps/school/templates/blocks/day_pay_btn.html
+++ b/apps/school/templates/blocks/day_pay_btn.html
@@ -1,7 +1,5 @@
купить
diff --git a/apps/school/templates/blocks/schedule_item.html b/apps/school/templates/blocks/schedule_item.html
index 7860e437..27d4fcd4 100644
--- a/apps/school/templates/blocks/schedule_item.html
+++ b/apps/school/templates/blocks/schedule_item.html
@@ -5,17 +5,17 @@
{{ school_schedule }}
- {% if purchased and live_lesson %}
+ {% if is_purchased and live_lesson %}
{{ live_lesson.date }}
{% endif %}
{{ school_schedule.start_at }} (МСК)
- {% if purchased %}
- {% if school_schedule.weekday in school_schedules_purchased %}
- {% if live_lesson and live_lesson.title %}
- {% include './open_lesson.html' %}
- {% endif %}
+ {% if is_purchased %}
+ {% if school_schedule.weekday in school_schedules_purchased and live_lesson and live_lesson.title %}
+ {% include './open_lesson.html' %}
{% endif %}
+ {% else %}
+ {% include './day_pay_btn.html' %}
{% endif %}
diff --git a/apps/school/templates/summer/promo.html b/apps/school/templates/summer/promo.html
index 6995c7b9..a07fc442 100644
--- a/apps/school/templates/summer/promo.html
+++ b/apps/school/templates/summer/promo.html
@@ -5,16 +5,12 @@
Lil School — первая образовательная онлайн-платформа креативного мышления для детей
- Присоединяйтесь к школе с 1 сентября
+ Старт школы - 1 сентября
-
+
diff --git a/project/templates/blocks/popup_auth.html b/project/templates/blocks/popup_auth.html
index 50a62b55..092cee9b 100644
--- a/project/templates/blocks/popup_auth.html
+++ b/project/templates/blocks/popup_auth.html
@@ -37,10 +37,10 @@
-
+
-
+
@@ -53,7 +53,7 @@
или
-
+
ЧЕРЕЗ FACEBOOK
@@ -96,10 +96,10 @@
-
+
-
+
@@ -122,7 +122,7 @@
или
-
+
ЧЕРЕЗ FACEBOOK
diff --git a/project/templates/blocks/popup_buy.html b/project/templates/blocks/popup_buy.html
index 96b3b29d..d3080ec9 100644
--- a/project/templates/blocks/popup_buy.html
+++ b/project/templates/blocks/popup_buy.html
@@ -89,7 +89,7 @@
diff --git a/project/templates/blocks/promo.html b/project/templates/blocks/promo.html
index fd000cba..f6f49349 100644
--- a/project/templates/blocks/promo.html
+++ b/project/templates/blocks/promo.html
@@ -46,27 +46,20 @@
{% else %}
- Приглашаем вас на месяц открытых дверей в Lil School
+ Приглашаем вас присоединиться к онлайн-школе с 1 сентября!
- {% comment %}
{% if not is_purchased and not is_purchased_future %}
- Получить доступ
+ купить доступ от {{ min_school_price }} руб./месяц
+ {% else %}
+
Подробнее
{% endif %}
- {% endcomment %}
-
Подробнее
{% endif %}
diff --git a/web/src/js/modules/auth.js b/web/src/js/modules/auth.js
index 07f65cda..7df79e62 100644
--- a/web/src/js/modules/auth.js
+++ b/web/src/js/modules/auth.js
@@ -5,6 +5,7 @@ import isLength from 'validator/lib/isLength';
$(document).ready(function () {
let auth = $('.js-auth'),
+ popup = $('.js-popup-auth'),
type = auth.find('.js-auth-type'),
tab = auth.find('.js-auth-tab'),
login = auth.find('.js-auth-login'),
@@ -153,7 +154,13 @@ $(document).ready(function () {
})
.done(function (data) {
if (data.success === true) {
- location.reload();
+ const nextUrl = popup.data('next-url');
+ if(nextUrl){
+ window.location.href = nextUrl;
+ }
+ else{
+ window.location.reload();
+ }
} else {
authButton.removeClass('loading');
}
@@ -234,7 +241,13 @@ $(document).ready(function () {
})
.done(function (data) {
if (data.success === true) {
- location.reload();
+ const nextUrl = popup.data('next-url');
+ if(nextUrl){
+ window.location.href = nextUrl;
+ }
+ else{
+ window.location.reload();
+ }
} else {
registrationButton.removeClass('loading');
}
@@ -275,7 +288,7 @@ $(document).ready(function () {
if (facebookResponse) {
if (facebookResponse.status === 'connected') {
- login_with_facebook(facebookResponse.authResponse.accessToken);
+ login_with_facebook(facebookResponse.authResponse.accessToken, popup.data('next-url'));
return;
}
}
@@ -305,14 +318,19 @@ function load_facebook() {
});
}
-function login_with_facebook(accessToken) {
+function login_with_facebook(accessToken, nextUrl) {
$.ajax('/auth/facebook_login/', {
method: 'POST',
data: {'access_token': accessToken},
})
.done(function (data) {
if (data.success === true) {
- location.reload();
+ if(nextUrl){
+ window.location.href = nextUrl;
+ }
+ else{
+ window.location.reload();
+ }
}
})
.fail(function (xhr) {
diff --git a/web/src/js/modules/popup.js b/web/src/js/modules/popup.js
index a1a91d9f..425f81cd 100644
--- a/web/src/js/modules/popup.js
+++ b/web/src/js/modules/popup.js
@@ -31,6 +31,24 @@ $(document).ready(function () {
});
is_extend = true;
}
+ if(! window.LIL_STORE.user.id) {
+ const $btn = popup.find('.buy__btn');
+ $btn.click(function(event) {
+ event.preventDefault();
+ hidePopup().then(() => {
+ popup = $('.js-popup-auth');
+ popup.data('next-url', $btn.attr('href'));
+ showPopup();
+ });
+ });
+ }
+ }
+ if( data === '.js-popup-auth') {
+ let nextUrl = $(this).data('auth-next-url');
+ if(nextUrl === 'href') {
+ nextUrl = $(this).attr('href');
+ }
+ popup.data('next-url', nextUrl);
}
if($(this).data('day')) {
@@ -70,21 +88,28 @@ $(document).ready(function () {
function showPopup(){
body.addClass('no-scroll');
popup.addClass('open');
- setTimeout(function(){
- popup.addClass('visible');
- }, 100);
+ return new Promise((resolve) => {
+ setTimeout(function(){
+ popup.addClass('visible');
+ resolve();
+ }, 100);
+ });
}
function hidePopup(){
body.removeClass('no-scroll');
popup.removeClass('visible');
- setTimeout(function(){
- popup.removeClass('open');
- }, 300);
+ popup.data('next-url', null);
if($('#password-reset__sent').is(':visible')) {
window.location.reload();
}
+ return new Promise((resolve) => {
+ setTimeout(function(){
+ popup.removeClass('open');
+ resolve();
+ }, 300);
+ });
}
$(document).on('change', '[data-day]', function(){