diff --git a/lms/djangoapps/courseware/tabs.py b/lms/djangoapps/courseware/tabs.py index d0fa746437..6fd2f425bf 100644 --- a/lms/djangoapps/courseware/tabs.py +++ b/lms/djangoapps/courseware/tabs.py @@ -10,6 +10,7 @@ from django.utils.translation import ugettext as _, ugettext_noop from courseware.access import has_access from courseware.entrance_exams import user_can_skip_entrance_exam from openedx.core.lib.course_tabs import CourseTabPluginManager +from openedx.features.course_experience import UNIFIED_COURSE_VIEW_FLAG from request_cache.middleware import RequestCache from student.models import CourseEnrollment from xmodule.tabs import CourseTab, CourseTabList, key_checker, link_reverse_func @@ -43,7 +44,7 @@ class CoursewareTab(EnrolledTab): """ Returns the main course URL for the current user. """ - if waffle.flag_is_active(request, 'unified_course_view'): + if waffle.flag_is_active(request, UNIFIED_COURSE_VIEW_FLAG): return 'edx.course_experience.course_home' else: return 'courseware' diff --git a/lms/djangoapps/courseware/views/index.py b/lms/djangoapps/courseware/views/index.py index 7de2fcc051..0813cbbe2d 100644 --- a/lms/djangoapps/courseware/views/index.py +++ b/lms/djangoapps/courseware/views/index.py @@ -33,6 +33,7 @@ from openedx.core.djangoapps.user_api.preferences.api import get_user_preference from openedx.core.djangoapps.crawlers.models import CrawlersConfig from openedx.core.djangoapps.monitoring_utils import set_custom_metrics_for_course_key from openedx.features.enterprise_support.api import data_sharing_consent_required +from openedx.features.course_experience import UNIFIED_COURSE_VIEW_FLAG from request_cache.middleware import RequestCache from shoppingcart.models import CourseRegistrationCode from student.views import is_course_blocked @@ -338,7 +339,7 @@ class CoursewareIndex(View): 'disable_optimizely': True, 'section_title': None, 'sequence_title': None, - 'disable_accordion': waffle.flag_is_active(request, 'unified_course_view') + 'disable_accordion': waffle.flag_is_active(request, UNIFIED_COURSE_VIEW_FLAG), } table_of_contents = toc_for_course( self.effective_user, diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html index 128f9b6ab1..41aa56fabb 100644 --- a/lms/templates/courseware/courseware.html +++ b/lms/templates/courseware/courseware.html @@ -12,6 +12,7 @@ from django.utils.translation import ugettext as _ from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled from openedx.core.djangolib.js_utils import js_escaped_string from openedx.core.djangolib.markup import HTML +from openedx.features.course_experience import UNIFIED_COURSE_VIEW_FLAG %> <% include_special_exams = settings.FEATURES.get('ENABLE_SPECIAL_EXAMS', False) and (course.enable_proctored_exams or course.enable_timed_exams) @@ -157,7 +158,7 @@ ${HTML(fragment.foot_html())}
% if getattr(course, 'entrance_exam_enabled') and \ getattr(course, 'entrance_exam_minimum_score_pct') and \ diff --git a/openedx/features/course_experience/__init__.py b/openedx/features/course_experience/__init__.py index e69de29bb2..b4428c50f8 100644 --- a/openedx/features/course_experience/__init__.py +++ b/openedx/features/course_experience/__init__.py @@ -0,0 +1,4 @@ +# Unified course experience settings + +UNIFIED_COURSE_EXPERIENCE_FLAG = 'unified_course_experience' +UNIFIED_COURSE_VIEW_FLAG = 'unified_course_view' diff --git a/openedx/features/course_experience/templates/course_experience/course-home-fragment.html b/openedx/features/course_experience/templates/course_experience/course-home-fragment.html index 557ad53f9d..6373b447b2 100644 --- a/openedx/features/course_experience/templates/course_experience/course-home-fragment.html +++ b/openedx/features/course_experience/templates/course_experience/course-home-fragment.html @@ -5,6 +5,8 @@ <%! import json +import waffle + from django.conf import settings from django.utils.translation import ugettext as _ from django.template.defaultfilters import escapejs @@ -13,6 +15,7 @@ from django.core.urlresolvers import reverse from django_comment_client.permissions import has_permission from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string from openedx.core.djangolib.markup import HTML +from openedx.features.course_experience import UNIFIED_COURSE_EXPERIENCE_FLAG %> <%block name="content"> @@ -25,9 +28,11 @@ from openedx.core.djangolib.markup import HTML