Commit fef6f64a by Florian Haas

lms: Only show welcome video if show_homepage_promo_video is set

While show_homepage_promo_video would previously toggle the control to
play the welcome video on and off, the YouTube embed iframe would be
included in index.html unconditionally. This created the ugly
situation that YouTube would try to pull in a non-existent video, and
that a DoubleClick tracking beacon would be introduced to the start
page for no reason.

Instead, make sure show_homepage_promo_video toggles the entire modal
video section on and off, suppressing it altogether unless
show_homepage_promo_video is set.
parent b74e2d9e
...@@ -48,9 +48,8 @@ class LmsIndexPageTest(BaseLmsIndexTest): ...@@ -48,9 +48,8 @@ class LmsIndexPageTest(BaseLmsIndexTest):
# Ensure the introduction video element is not shown # Ensure the introduction video element is not shown
self.assertFalse(self.page.intro_video_element.visible) self.assertFalse(self.page.intro_video_element.visible)
# @fghaas: The below presence check can now be modified along with your changeset
# Still need to figure out how to swap platform settings in the context of a bok choy test # Still need to figure out how to swap platform settings in the context of a bok choy test
# but we can at least prevent accidental exposure with these validations going forward # but we can at least prevent accidental exposure with these validations going forward
# Note: 'present' is a DOM check, whereas 'visible' is an actual browser/screen check # Note: 'present' is a DOM check, whereas 'visible' is an actual browser/screen check
self.assertTrue(self.page.video_modal_element.present) self.assertFalse(self.page.video_modal_element.present)
self.assertFalse(self.page.video_modal_element.visible) self.assertFalse(self.page.video_modal_element.visible)
...@@ -53,16 +53,18 @@ from django.core.urlresolvers import reverse ...@@ -53,16 +53,18 @@ from django.core.urlresolvers import reverse
</section> </section>
<section id="video-modal" class="modal home-page-video-modal video-modal"> % if show_homepage_promo_video:
<div class="inner-wrapper"> <section id="video-modal" class="modal home-page-video-modal video-modal">
<% <div class="inner-wrapper">
youtube_video_id = homepage_promo_video_youtube_id <%
if self.stanford_theme_enabled(): youtube_video_id = homepage_promo_video_youtube_id
youtube_video_id = "2gmreZObCY4" if self.stanford_theme_enabled():
%> youtube_video_id = "2gmreZObCY4"
<iframe title="YouTube Video" width="640" height="360" src="//www.youtube.com/embed/${youtube_video_id}?showinfo=0" frameborder="0" allowfullscreen></iframe> %>
</div> <iframe title="YouTube Video" width="640" height="360" src="//www.youtube.com/embed/${youtube_video_id}?showinfo=0" frameborder="0" allowfullscreen></iframe>
</section> </div>
</section>
% endif
<%block name="js_extra"> <%block name="js_extra">
<script type="text/javascript"> <script type="text/javascript">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment