From 31e4ab8d2ad72cee4c558c41d896699ff985b2fd Mon Sep 17 00:00:00 2001 From: gzbender Date: Fri, 2 Aug 2019 10:52:49 +0300 Subject: [PATCH 1/6] =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D1=82=D1=8C=20?= =?UTF-8?q?=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D1=83=20=D1=80=D0=B8=D1=81=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BB=D0=B0?= =?UTF-8?q?=D0=B3=D0=B5=D1=80=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/templates/lilcity/home.html | 1 - 1 file changed, 1 deletion(-) diff --git a/project/templates/lilcity/home.html b/project/templates/lilcity/home.html index e052e724..6f3e7d34 100644 --- a/project/templates/lilcity/home.html +++ b/project/templates/lilcity/home.html @@ -13,7 +13,6 @@ {% block title %}School LIL.CITY{% endblock title %} {% block content %} {% include "templates/blocks/messages.html" %} - {% include "templates/blocks/buy.html" %} {% include "templates/blocks/about.html" %} {% include "templates/blocks/video.html" %} {% include "templates/blocks/counters.html" %} From c5e6ee4b75d24761b73f37efeb07222504d83004 Mon Sep 17 00:00:00 2001 From: gzbender Date: Fri, 2 Aug 2019 14:36:50 +0300 Subject: [PATCH 2/6] =?UTF-8?q?=D0=BE=D0=BA=D0=BD=D0=BE=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B3=D0=B8=20=D0=BF=D1=80=D0=B8=20=D0=BF=D1=80=D0=BE=D1=81?= =?UTF-8?q?=D0=BC=D0=BE=D1=82=D1=80=D0=B5=203=20=D0=BC=D0=B8=D0=BD=D1=83?= =?UTF-8?q?=D1=82=20=D0=B1=D0=B5=D1=81=D0=BF=D0=BB=D0=B0=D1=82=D0=BD=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D1=83=D1=80=D0=BE=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../school/templates/school/free_lessons.html | 2 +- web/src/js/modules/popup.js | 36 +++++++++++-------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/apps/school/templates/school/free_lessons.html b/apps/school/templates/school/free_lessons.html index e740d2b1..d67d0d15 100644 --- a/apps/school/templates/school/free_lessons.html +++ b/apps/school/templates/school/free_lessons.html @@ -14,7 +14,7 @@
-
Приглашай друзей и получай лилики. { - if(window.LIL_STORE.user.id || ! $(e.target).data('trialLesson') || Cookies.get(EMAIL_CAPTURED_COOKIE)){ + if(window.LIL_STORE.user.id || $(e.target).data('trialLesson') && Cookies.get(EMAIL_CAPTURED_COOKIE) + || ! $(e.target).data('freeLesson')){ return; } const channel = $(e.target).data('channel'); const player = e.detail.player; let timeout = null; - const interval = 1000 * 60; // 1 min + const freeLesson = $(e.target).data('freeLesson') + const interval = 1000 * (freeLesson ? 180 : 60); // 1 min const pauseVideo = () => { timeout = setTimeout(() => { clearTimeout(timeout); @@ -118,18 +120,24 @@ $(document).ready(function () { player.pause(); } $modalVideo.css('opacity', 0); - captureEmail(true).then(() => { - $modalVideo.css('opacity', 1); - Cookies.set(EMAIL_CAPTURED_COOKIE, 1); - if(channel == 'youtube'){ - player.playVideo(); - } - else if(channel == 'vimeo'){ - player.play(); - } - }).catch(() => { - $('.modal-video').remove(); - }); + if(freeLesson){ + popup = $('.js-popup-auth'); + showPopup(); + } + else{ + captureEmail(true).then(() => { + $modalVideo.css('opacity', 1); + Cookies.set(EMAIL_CAPTURED_COOKIE, 1); + if(channel == 'youtube'){ + player.playVideo(); + } + else if(channel == 'vimeo'){ + player.play(); + } + }).catch(() => { + $('.modal-video').remove(); + }); + } }, interval); } if(channel == 'youtube'){ From 453e42e02ff629d27004e5b7142d7f4f9be6fe63 Mon Sep 17 00:00:00 2001 From: gzbender Date: Fri, 2 Aug 2019 15:16:47 +0300 Subject: [PATCH 3/6] =?UTF-8?q?=D0=B2=D1=80=D0=B5=D0=BC=D1=8F=20=D0=BD?= =?UTF-8?q?=D0=B0=D1=87=D0=B0=D0=BB=D0=B0=20=D1=83=D1=80=D0=BE=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/school/templates/school/free_lessons.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/school/templates/school/free_lessons.html b/apps/school/templates/school/free_lessons.html index d67d0d15..fa3c12b9 100644 --- a/apps/school/templates/school/free_lessons.html +++ b/apps/school/templates/school/free_lessons.html @@ -39,7 +39,7 @@ В августе 4 раза в неделю наши преподаватели БЕСПЛАТНО приглашают вас посетить одну из стран нашего многообразного Мира!

Когда?
-Со 2 по 19 августа.

+Со 2 по 19 августа в 17:00.

Где?
Здесь, на этой странице.

From 83737506c4af261e0f8df0173143ef9e7c4bb0ea Mon Sep 17 00:00:00 2001 From: gzbender Date: Sat, 3 Aug 2019 23:15:16 +0300 Subject: [PATCH 4/6] =?UTF-8?q?=D0=BD=D0=B5=20=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=B0=D1=8E=D1=82=20=D0=BF=D0=BE=D0=BF=D0=B0=D0=BF=D1=8B?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D0=BD=D0=B5=D0=BA=D0=BE=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D1=8B=D1=85=20=D1=83=D1=81=D1=82=D1=80=D0=BE=D0=B9=D1=81=D1=82?= =?UTF-8?q?=D0=B2=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/js/modules/popup.js | 206 ++++++++++++++++++------------------ 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/web/src/js/modules/popup.js b/web/src/js/modules/popup.js index 53d01af2..c22970d7 100644 --- a/web/src/js/modules/popup.js +++ b/web/src/js/modules/popup.js @@ -67,104 +67,6 @@ $(document).ready(function () { }); }; - $(".js-video-modal").each(function(){ - const $this = $(this); - const url = $this.data('videoUrl'); - if(! url){ - return; - } - let data; - let videoId; - let channel; - if(url.indexOf('youtu.be') > -1){ - videoId = url.split('youtu.be/')[1]; - channel = 'youtube'; - } - if(url.indexOf('youtube.com') > -1 && url.indexOf('watch') > -1){ - const m = /[?&]v=([^&]+)(&.+)?$/.exec(url); - channel = 'youtube'; - videoId = m && m[1]; - } - if(url.indexOf('vimeo.com') > -1){ - const split = url.split('/'); - channel = 'vimeo'; - videoId = split[split.length - 1]; - } - $this.attr('data-video-id', videoId); - $this.attr('data-video-url', ''); - $this.attr('data-channel', channel); - $this.modalVideo({ channel, jsapi: true }); - }); - - $(".js-video-modal").on('player-created', e => { - if(window.LIL_STORE.user.id || $(e.target).data('trialLesson') && Cookies.get(EMAIL_CAPTURED_COOKIE) - || ! $(e.target).data('freeLesson')){ - return; - } - const channel = $(e.target).data('channel'); - const player = e.detail.player; - let timeout = null; - const freeLesson = $(e.target).data('freeLesson') - const interval = 1000 * (freeLesson ? 180 : 60); // 1 min - const pauseVideo = () => { - timeout = setTimeout(() => { - clearTimeout(timeout); - const $modalVideo = $('.modal-video'); - if(! $modalVideo.length){ - return; - } - if(channel == 'youtube'){ - player.pauseVideo(); - } - else if(channel == 'vimeo'){ - player.pause(); - } - $modalVideo.css('opacity', 0); - if(freeLesson){ - popup = $('.js-popup-auth'); - showPopup(); - } - else{ - captureEmail(true).then(() => { - $modalVideo.css('opacity', 1); - Cookies.set(EMAIL_CAPTURED_COOKIE, 1); - if(channel == 'youtube'){ - player.playVideo(); - } - else if(channel == 'vimeo'){ - player.play(); - } - }).catch(() => { - $('.modal-video').remove(); - }); - } - }, interval); - } - if(channel == 'youtube'){ - window.onYTPlayerStateChange = (event) => { - if(event.data == YT.PlayerState.PLAYING && ! timeout){ - pauseVideo(); - } - if(event.data == YT.PlayerState.ENDED && timeout){ - clearTimeout(timeout); - } - } - player.addEventListener('onStateChange', 'onYTPlayerStateChange'); - } - else if (channel == 'vimeo'){ - player.on('play', () => { - if(! timeout){ - pauseVideo(); - } - }) - player.on('ended', () => { - if(timeout){ - clearTimeout(timeout); - } - }); - } - }); - body.on('click', '[data-popup]', function(e){ const $this = $(this); let data = $this.data('popup'); @@ -176,7 +78,7 @@ $(document).ready(function () { popup = $(data); - if(data === '.js-popup-buy') { + if(data == '.js-popup-buy') { popup.data('date-start', $this.data('date-start') || ''); popup.data('day', $this.data('day') || ''); popup.data('is-camp', $this.data('is-camp') || ''); @@ -229,7 +131,7 @@ $(document).ready(function () { updateCart(); } - if(data === '.js-popup-course-buy'){ + if(data == '.js-popup-course-buy'){ const updateCourseCart = () => { const $orderPrice = popup.find('.order_price_text'); const useBonuses = $bonusesCheckbox.prop('checked'); @@ -270,7 +172,7 @@ $(document).ready(function () { popup.data('next-url', nextUrl); } - if( data === '.js-popup-enter-gift-code') { + if( data == '.js-popup-enter-gift-code') { const $giftCode = popup.find('.enter-gift-code__code'); const $giftError = popup.find('.enter-gift-code__error'); $giftCode.val(''); @@ -287,7 +189,7 @@ $(document).ready(function () { const showDef = showPopup(); - if( data === '.js-popup-auth') { + if( data == '.js-popup-auth') { showDef.then(() => { const login = popup.find('.js-auth-login'); const pass = popup.find('.js-auth-pass'); @@ -296,7 +198,7 @@ $(document).ready(function () { }); } - if(data === '.js-popup-ref-link') { + if(data == '.js-popup-ref-link') { showDef.then(() => { $('#referrer-url').select(); }); @@ -333,6 +235,104 @@ $(document).ready(function () { showPopup(); } + $(".js-video-modal").each(function(){ + const $this = $(this); + const url = $this.data('videoUrl'); + if(! url){ + return; + } + let data; + let videoId; + let channel; + if(url.indexOf('youtu.be') > -1){ + videoId = url.split('youtu.be/')[1]; + channel = 'youtube'; + } + if(url.indexOf('youtube.com') > -1 && url.indexOf('watch') > -1){ + const m = /[?&]v=([^&]+)(&.+)?$/.exec(url); + channel = 'youtube'; + videoId = m && m[1]; + } + if(url.indexOf('vimeo.com') > -1){ + const split = url.split('/'); + channel = 'vimeo'; + videoId = split[split.length - 1]; + } + $this.attr('data-video-id', videoId); + $this.attr('data-video-url', ''); + $this.attr('data-channel', channel); + $this.modalVideo({ channel, jsapi: true }); + }); + + $(".js-video-modal").on('player-created', e => { + if(window.LIL_STORE.user.id || $(e.target).data('trialLesson') && Cookies.get(EMAIL_CAPTURED_COOKIE) + || ! $(e.target).data('freeLesson')){ + return; + } + const channel = $(e.target).data('channel'); + const player = e.detail.player; + let timeout = null; + const freeLesson = $(e.target).data('freeLesson') + const interval = 1000 * (freeLesson ? 180 : 60); // 1 min + const pauseVideo = () => { + timeout = setTimeout(() => { + clearTimeout(timeout); + const $modalVideo = $('.modal-video'); + if(! $modalVideo.length){ + return; + } + if(channel == 'youtube'){ + player.pauseVideo(); + } + else if(channel == 'vimeo'){ + player.pause(); + } + $modalVideo.css('opacity', 0); + if(freeLesson){ + popup = $('.js-popup-auth'); + showPopup(); + } + else{ + captureEmail(true).then(() => { + $modalVideo.css('opacity', 1); + Cookies.set(EMAIL_CAPTURED_COOKIE, 1); + if(channel == 'youtube'){ + player.playVideo(); + } + else if(channel == 'vimeo'){ + player.play(); + } + }).catch(() => { + $('.modal-video').remove(); + }); + } + }, interval); + } + if(channel == 'youtube'){ + window.onYTPlayerStateChange = (event) => { + if(event.data == YT.PlayerState.PLAYING && ! timeout){ + pauseVideo(); + } + if(event.data == YT.PlayerState.ENDED && timeout){ + clearTimeout(timeout); + } + } + player.addEventListener('onStateChange', 'onYTPlayerStateChange'); + } + else if (channel == 'vimeo'){ + player.on('play', () => { + if(! timeout){ + pauseVideo(); + } + }) + player.on('ended', () => { + if(timeout){ + clearTimeout(timeout); + } + }); + } + }); + if(window.LIL_STORE.user.id && window.LIL_STORE.user.hasNewBonuses && window.LIL_STORE.user.bonus > 0){ $(document).ready(() => { popup = $('.js-popup-bonuses-came'); From 426304e4feeb02a4df84a9c0b2a6c7062f5696a6 Mon Sep 17 00:00:00 2001 From: gzbender Date: Sat, 3 Aug 2019 23:23:21 +0300 Subject: [PATCH 5/6] =?UTF-8?q?=D0=BD=D0=B5=20=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=B0=D1=8E=D1=82=20=D0=BF=D0=BE=D0=BF=D0=B0=D0=BF=D1=8B?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D0=BD=D0=B5=D0=BA=D0=BE=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D1=8B=D1=85=20=D1=83=D1=81=D1=82=D1=80=D0=BE=D0=B9=D1=81=D1=82?= =?UTF-8?q?=D0=B2=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/js/modules/popup.js | 64 ++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/web/src/js/modules/popup.js b/web/src/js/modules/popup.js index c22970d7..b3b18a93 100644 --- a/web/src/js/modules/popup.js +++ b/web/src/js/modules/popup.js @@ -15,6 +15,38 @@ $(document).ready(function () { popup = $('.popup.visible.open'), prevPopup = null; + function showPopup(){ + if(! popup && popupName){ + popup = $(popupName); + } + body.addClass('no-scroll'); + popup.addClass('open'); + return new Promise((resolve) => { + setTimeout(function(){ + popup.addClass('visible'); + resolve(); + $(document).trigger('popup-opened', [popup]); + }, 100); + }); + } + + function hidePopup(){ + body.removeClass('no-scroll'); + popup.removeClass('visible'); + popup.data('next-url', null); + + if($('#password-reset__sent').is(':visible')) { + window.location.reload(); + } + return new Promise((resolve) => { + setTimeout(function(){ + popup.removeClass('open'); + resolve(); + $(document).trigger('popup-closed', [popup]); + }, 300); + }); + } + // CAPTURE EMAIL const EMAIL_CAPTURED_COOKIE = 'email-captured'; @@ -382,38 +414,6 @@ $(document).ready(function () { }); } - function showPopup(){ - if(! popup && popupName){ - popup = $(popupName); - } - body.addClass('no-scroll'); - popup.addClass('open'); - return new Promise((resolve) => { - setTimeout(function(){ - popup.addClass('visible'); - resolve(); - $(document).trigger('popup-opened', [popup]); - }, 100); - }); - } - - function hidePopup(){ - body.removeClass('no-scroll'); - popup.removeClass('visible'); - popup.data('next-url', null); - - if($('#password-reset__sent').is(':visible')) { - window.location.reload(); - } - return new Promise((resolve) => { - setTimeout(function(){ - popup.removeClass('open'); - resolve(); - $(document).trigger('popup-closed', [popup]); - }, 300); - }); - } - function updateCart(){ var link = popup.find('.but_btn_popup').data('link'); var $order = popup.find('.order'); From 996fa846e49891c4d1d345a87f7fffb78b7b8104 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 5 Aug 2019 14:26:36 +0300 Subject: [PATCH 6/6] expires --- docker/conf/nginx/conf.d/default.conf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docker/conf/nginx/conf.d/default.conf b/docker/conf/nginx/conf.d/default.conf index f78513ae..1ee0430c 100644 --- a/docker/conf/nginx/conf.d/default.conf +++ b/docker/conf/nginx/conf.d/default.conf @@ -32,16 +32,12 @@ server { location /static/ { alias /app/static/; - expires -1; + expires 1y; } location /media/ { alias /app/media/; - - location /media/instagram/results/ { - expires 1d; - try_files $uri @prod; - } + expires 1y; try_files $uri @prod; }