Merge branch 'hotfix/youtube-video-error-29-05-19' into 'master'

Hotfix/youtube video error 29 05 19

See merge request lilschool/site!306
remotes/origin/hotfix/camp-school-fix-1-06-19
Danil 7 years ago
commit 07039861bf
  1. 4
      apps/school/templates/blocks/schedule_item.html
  2. 6
      project/templates/blocks/video.html
  3. 2
      web/src/js/modules/popup.js

@ -7,7 +7,7 @@
<div class="timing__day{% if school_schedule.is_online %} active{% endif %}">
{{ school_schedule }}
{% if not is_purchased and request.user_agent.is_mobile and school_schedule.trial_lesson %}
<a class="timing__trial-lesson js-video-modal" href="#" data-trial-lesson="1" data-video-url="{{ school_schedule.trial_lesson }}">Пробный урок</a>
<a class="timing__trial-lesson js-video-modal" href="#" data-trial-lesson="1" data-video-url="{{ school_schedule.trial_lesson|safe }}">Пробный урок</a>
{% endif %}
</div>
{% if is_purchased and live_lesson %}
@ -25,7 +25,7 @@
{% endif %}
{% endif %}
{% if not is_purchased and not request.user_agent.is_mobile and school_schedule.trial_lesson and not is_drawing_camp %}
<a class="timing__trial-lesson js-video-modal" href="#" data-trial-lesson="1" data-video-url="{{ school_schedule.trial_lesson }}">Пробный урок</a>
<a class="timing__trial-lesson js-video-modal" href="#" data-trial-lesson="1" data-video-url="{{ school_schedule.trial_lesson|safe }}">Пробный урок</a>
{% endif %}
</div>
</div>

@ -1,10 +1,10 @@
<div class="section section_video">
<div class="section__center center center_sm" style="text-align: center;">
<div class="title">Пробный урок</div>
<img class="main-video-preview js-video-modal" data-video-url="{{ config.MAIN_PAGE_VIDEO_URL }}" data-trial-lesson="1"
<img class="main-video-preview js-video-modal" data-video-url="{{ config.MAIN_PAGE_VIDEO_URL|safe }}" data-trial-lesson="1"
src="{{ config.MAIN_PAGE_VIDEO_PREVIEW_IMG.url }}"/>
<a href="#" class="btn js-video-modal btn_stroke-black" style="margin: 20px;"
data-video-url="{{ config.MAIN_PAGE_VIDEO_URL }}" data-trial-lesson="1">Смотреть бесплатно</a>
<div>Много развивающих видео на&nbsp;нашем <a href="{{ config.SERVICE_YOUTUBE_URL }}">YouTube&nbsp;канале</a></div>
data-video-url="{{ config.MAIN_PAGE_VIDEO_URL|safe }}" data-trial-lesson="1">Смотреть бесплатно</a>
<div>Много развивающих видео на&nbsp;нашем <a href="{{ config.SERVICE_YOUTUBE_URL|safe }}">YouTube&nbsp;канале</a></div>
</div>
</div>

@ -81,7 +81,7 @@ $(document).ready(function () {
channel = 'youtube';
}
if(url.indexOf('youtube.com') > -1 && url.indexOf('watch') > -1){
const m = /[?&]v=([a-zA-Z\d]+)(&.)?/.exec(url);
const m = /[?&]v=([^&]+)(&.+)?$/.exec(url);
channel = 'youtube';
videoId = m && m[1];
}

Loading…
Cancel
Save