diff --git a/lms/djangoapps/courseware/views/index.py b/lms/djangoapps/courseware/views/index.py index 0dd7ce00a2..18d95218c9 100644 --- a/lms/djangoapps/courseware/views/index.py +++ b/lms/djangoapps/courseware/views/index.py @@ -409,6 +409,10 @@ class CoursewareIndex(View): """ course_url_name = default_course_url_name(self.course.id) course_url = reverse(course_url_name, kwargs={'course_id': six.text_type(self.course.id)}) + show_search = ( + settings.FEATURES.get('ENABLE_COURSEWARE_SEARCH') or + (settings.FEATURES.get('ENABLE_COURSEWARE_SEARCH_FOR_COURSE_STAFF') and self.is_staff) + ) courseware_context = { 'csrf': csrf(self.request)['csrf_token'], @@ -430,6 +434,7 @@ class CoursewareIndex(View): 'section_title': None, 'sequence_title': None, 'disable_accordion': COURSE_OUTLINE_PAGE_FLAG.is_enabled(self.course.id), + 'show_search': show_search, } courseware_context.update( get_experiment_user_metadata_context( diff --git a/lms/envs/common.py b/lms/envs/common.py index cdb1a4f398..7c2274edb4 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -294,6 +294,7 @@ FEATURES = { # Courseware search feature 'ENABLE_COURSEWARE_SEARCH': False, + 'ENABLE_COURSEWARE_SEARCH_FOR_COURSE_STAFF': False, # Dashboard search feature 'ENABLE_DASHBOARD_SEARCH': False, diff --git a/lms/envs/devstack_docker.py b/lms/envs/devstack_docker.py index d88a7cb384..83c128a267 100644 --- a/lms/envs/devstack_docker.py +++ b/lms/envs/devstack_docker.py @@ -34,6 +34,7 @@ JWT_AUTH.update({ FEATURES.update({ 'AUTOMATIC_AUTH_FOR_TESTING': True, 'ENABLE_COURSEWARE_SEARCH': False, + 'ENABLE_COURSEWARE_SEARCH_FOR_COURSE_STAFF': True, 'ENABLE_COURSE_DISCOVERY': False, 'ENABLE_DASHBOARD_SEARCH': False, 'ENABLE_DISCUSSION_SERVICE': True, diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html index 3cb573538e..6dba5cd21c 100644 --- a/lms/templates/courseware/courseware.html +++ b/lms/templates/courseware/courseware.html @@ -74,7 +74,7 @@ from openedx.features.course_experience import course_home_page_title, COURSE_OU <%static:js group='courseware'/> <%include file="/mathjax_include.html" args="disable_fast_preview=True"/> - % if settings.FEATURES.get('ENABLE_COURSEWARE_SEARCH'): + % if show_search: <%static:require_module module_name="course_search/js/course_search_factory" class_name="CourseSearchFactory"> var courseId = $('.courseware-results').data('courseId'); CourseSearchFactory({ @@ -136,7 +136,7 @@ ${HTML(fragment.foot_html())} - % if settings.FEATURES.get('ENABLE_COURSEWARE_SEARCH'): + % if show_search:
- % if settings.FEATURES.get('ENABLE_COURSEWARE_SEARCH'): + % if show_search: