diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index 63e1a6b792..528b2714c9 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -17,6 +17,7 @@ from xmodule.exceptions import NotFoundError, ProcessingError from xmodule.library_tools import LibraryToolsService from xmodule.modulestore.django import modulestore, ModuleI18nService from opaque_keys.edx.keys import UsageKey +from opaque_keys.edx.locator import LibraryUsageLocator from xmodule.x_module import ModuleSystem from xblock.runtime import KvsFieldData from xblock.django.request import webob_to_django_response, django_to_webob_request @@ -242,6 +243,7 @@ def _studio_wrap_xblock(xblock, view, frag, context, display_name_only=False): # Only add the Studio wrapper when on the container page. The "Pages" page will remain as is for now. if not context.get('is_pages_view', None) and view in PREVIEW_VIEWS: root_xblock = context.get('root_xblock') + can_edit_visibility = not isinstance(xblock.location, LibraryUsageLocator) is_root = root_xblock and xblock.location == root_xblock.location is_reorderable = _is_xblock_reorderable(xblock, context) template_context = { @@ -251,6 +253,7 @@ def _studio_wrap_xblock(xblock, view, frag, context, display_name_only=False): 'is_root': is_root, 'is_reorderable': is_reorderable, 'can_edit': context.get('can_edit', True), + 'can_edit_visibility': can_edit_visibility, } html = render_to_string('studio_xblock_wrapper.html', template_context) frag = wrap_fragment(frag, html) diff --git a/cms/envs/common.py b/cms/envs/common.py index 30657f0a5a..3aea5b983b 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -122,6 +122,12 @@ FEATURES = { # for consistency in user-experience, keep the value of this feature flag # in sync with the one in lms/envs/common.py 'ENABLE_EDXNOTES': False, + + # Enable support for content libraries. Note that content libraries are + # only supported in courses using split mongo. Change the setting + # DEFAULT_STORE_FOR_NEW_COURSE to be 'split' to have future courses + # and libraries created with split. + 'ENABLE_CONTENT_LIBRARIES': False, } ENABLE_JASMINE = False diff --git a/cms/static/js/spec/views/pages/container_spec.js b/cms/static/js/spec/views/pages/container_spec.js index b7e2b6facb..37025ee838 100644 --- a/cms/static/js/spec/views/pages/container_spec.js +++ b/cms/static/js/spec/views/pages/container_spec.js @@ -594,6 +594,7 @@ define(["jquery", "underscore", "underscore.string", "js/common_helpers/ajax_hel }); } + // Create a suite for a non-paged container that includes 'edit visibility' buttons parameterized_suite("Non paged", { }, { @@ -603,6 +604,8 @@ define(["jquery", "underscore", "underscore.string", "js/common_helpers/ajax_hel has_visibility_editor: true } ); + + // Create a suite for a paged container that does not include 'edit visibility' buttons parameterized_suite("Paged", { page_size: 42 }, { @@ -610,5 +613,6 @@ define(["jquery", "underscore", "underscore.string", "js/common_helpers/ajax_hel initial: 'mock/mock-container-paged-xblock.underscore', add_response: 'mock/mock-xblock-paged.underscore', has_visibility_editor: false - }); + } + ); }); diff --git a/cms/templates/studio_xblock_wrapper.html b/cms/templates/studio_xblock_wrapper.html index 11beba2c9a..8f22f245ae 100644 --- a/cms/templates/studio_xblock_wrapper.html +++ b/cms/templates/studio_xblock_wrapper.html @@ -68,6 +68,14 @@ messages = json.dumps(xblock.validate().to_json()) + % if can_edit_visibility: +