diff --git a/common/djangoapps/edxmako/shortcuts.py b/common/djangoapps/edxmako/shortcuts.py index ff86cf8bcf..c17337c9c3 100644 --- a/common/djangoapps/edxmako/shortcuts.py +++ b/common/djangoapps/edxmako/shortcuts.py @@ -76,22 +76,6 @@ def marketing_link_context_processor(request): ] ) - -def header_footer_context_processor(request): - """ - A django context processor to pass feature flags through to all Django - Templates that are related to the display of the header and footer in - the edX platform. - """ - # TODO: ECOM-136 Remove this processor with the corresponding header and footer feature flags. - return dict( - [ - ("ENABLE_NEW_EDX_HEADER", settings.FEATURES.get("ENABLE_NEW_EDX_HEADER", False)), - ("ENABLE_NEW_EDX_FOOTER", settings.FEATURES.get("ENABLE_NEW_EDX_FOOTER", False)) - ] - ) - - def open_source_footer_context_processor(request): """ Checks the site name to determine whether to use the edX.org footer or the Open Source Footer. diff --git a/common/djangoapps/edxmako/tests.py b/common/djangoapps/edxmako/tests.py index 75b8c09715..40da9b63b8 100644 --- a/common/djangoapps/edxmako/tests.py +++ b/common/djangoapps/edxmako/tests.py @@ -14,7 +14,6 @@ from edxmako import add_lookup, LOOKUP from edxmako.shortcuts import ( marketing_link, render_to_string, - header_footer_context_processor, open_source_footer_context_processor ) from student.tests.factories import UserFactory @@ -40,17 +39,6 @@ class ShortcutsTests(UrlResetMixin, TestCase): link = marketing_link('ABOUT') self.assertEquals(link, expected_link) - @ddt.data((True, True), (False, False), (False, True), (True, False)) - @ddt.unpack - def test_header_and_footer(self, header_setting, footer_setting): - with patch.dict('django.conf.settings.FEATURES', { - 'ENABLE_NEW_EDX_HEADER': header_setting, - 'ENABLE_NEW_EDX_FOOTER': footer_setting, - }): - result = header_footer_context_processor({}) - self.assertEquals(footer_setting, result.get('ENABLE_NEW_EDX_FOOTER')) - self.assertEquals(header_setting, result.get('ENABLE_NEW_EDX_HEADER')) - @ddt.data((True, None), (False, None)) @ddt.unpack def test_edx_footer(self, expected_result, _): diff --git a/lms/envs/common.py b/lms/envs/common.py index c5dea04781..495150885a 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -273,15 +273,6 @@ FEATURES = { # Default to false here b/c dev environments won't have the api, will override in aws.py 'ENABLE_ANALYTICS_ACTIVE_COUNT': False, - # TODO: ECOM-136 remove this feature flag when new styles are available on main site.for - # Enable the new edX footer to be rendered. Defaults to false. - 'ENABLE_NEW_EDX_FOOTER': False, - - # TODO: ECOM-136 - # Enables the new navigation template and styles. This should be enabled - # when the styles appropriately match the edX.org website. - 'ENABLE_NEW_EDX_HEADER': False, - # When a logged in user goes to the homepage ('/') should the user be # redirected to the dashboard - this is default Open edX behavior. Set to # False to not redirect the user @@ -410,9 +401,6 @@ TEMPLATE_CONTEXT_PROCESSORS = ( # Allows the open edX footer to be leveraged in Django Templates. 'edxmako.shortcuts.open_source_footer_context_processor', - # TODO: Used for header and footer feature flags. Remove as part of ECOM-136 - 'edxmako.shortcuts.header_footer_context_processor', - # Shoppingcart processor (detects if request.user has a cart) 'shoppingcart.context_processor.user_has_cart_context_processor', diff --git a/lms/templates/footer-edx.html b/lms/templates/footer-legacy.html similarity index 100% rename from lms/templates/footer-edx.html rename to lms/templates/footer-legacy.html diff --git a/lms/templates/main.html b/lms/templates/main.html index c3895de287..68573776ff 100644 --- a/lms/templates/main.html +++ b/lms/templates/main.html @@ -79,19 +79,16 @@ else: header_extra_file = None - if settings.FEATURES.get("ENABLE_NEW_EDX_HEADER", False): - header_file = microsite.get_template_path('navigation.html') + if settings.FEATURES['IS_EDX_DOMAIN'] and not is_microsite(): + header_file = microsite.get_template_path('navigation-edx.html') else: - header_file = microsite.get_template_path('original_navigation.html') - + header_file = microsite.get_template_path('navigation.html') google_analytics_file = microsite.get_template_path('google_analytics.html') if settings.FEATURES['IS_EDX_DOMAIN'] and not is_microsite(): - if settings.FEATURES.get('ENABLE_NEW_EDX_FOOTER', False): - footer_file = microsite.get_template_path('footer-edx-new.html') - else: - footer_file = microsite.get_template_path('footer-edx.html') + footer_file = microsite.get_template_path('footer-edx-new.html') + else: footer_file = microsite.get_template_path('footer.html') diff --git a/lms/templates/main_django.html b/lms/templates/main_django.html index dd19587be9..7532f6e25a 100644 --- a/lms/templates/main_django.html +++ b/lms/templates/main_django.html @@ -32,10 +32,10 @@
{% trans "Skip to this view's content" %} {% with course=request.course %} - {% if ENABLE_NEW_EDX_HEADER %} - {% include "navigation.html" %} + {% if IS_EDX_DOMAIN %} + {% include "navigation-edx.html" %} {% else %} - {% include "original_navigation.html" %} + {% include "navigation.html" %} {% endif %} {% endwith %}