From fef6f64a7b5d045cf1f722115e889e2a6420d69e Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Tue, 5 Jan 2016 10:11:40 +0100 Subject: [PATCH] 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. --- .../acceptance/tests/lms/test_lms_index.py | 3 +-- lms/templates/index.html | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/common/test/acceptance/tests/lms/test_lms_index.py b/common/test/acceptance/tests/lms/test_lms_index.py index c9277da9e3..42ba7ab5b4 100644 --- a/common/test/acceptance/tests/lms/test_lms_index.py +++ b/common/test/acceptance/tests/lms/test_lms_index.py @@ -48,9 +48,8 @@ class LmsIndexPageTest(BaseLmsIndexTest): # Ensure the introduction video element is not shown 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 # 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 - self.assertTrue(self.page.video_modal_element.present) + self.assertFalse(self.page.video_modal_element.present) self.assertFalse(self.page.video_modal_element.visible) diff --git a/lms/templates/index.html b/lms/templates/index.html index c42aa4ec65..7f8e1246a7 100644 --- a/lms/templates/index.html +++ b/lms/templates/index.html @@ -53,16 +53,18 @@ from django.core.urlresolvers import reverse - +% if show_homepage_promo_video: + +% endif <%block name="js_extra">