diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index a4c3390a76..68650e9bc1 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -23,7 +23,6 @@ from xblock.exceptions import NoSuchHandlerError from xblock.fields import Scope from xblock.plugin import PluginMissingError from xblock.runtime import Mixologist -from xmodule.x_module import prefer_xmodules from lms.lib.xblock.runtime import unquote_slashes @@ -311,19 +310,19 @@ def container_handler(request, tag=None, package_id=None, branch=None, version_g except ItemNotFoundError: return HttpResponseBadRequest() - parent_xblocks = [] + ancestor_xblocks = [] parent = get_parent_xblock(xblock) while parent and parent.category != 'sequential': - parent_xblocks.append(parent) + ancestor_xblocks.append(parent) parent = get_parent_xblock(parent) - parent_xblocks.reverse() + ancestor_xblocks.reverse() return render_to_response('container.html', { 'context_course': course, 'xblock': xblock, 'xblock_locator': locator, - 'parent_xblocks': parent_xblocks, + 'ancestor_xblocks': ancestor_xblocks, }) else: return HttpResponseBadRequest("Only supports html requests") diff --git a/cms/djangoapps/contentstore/views/tests/test_item.py b/cms/djangoapps/contentstore/views/tests/test_item.py index de886fd4f3..2b225b9d8e 100644 --- a/cms/djangoapps/contentstore/views/tests/test_item.py +++ b/cms/djangoapps/contentstore/views/tests/test_item.py @@ -151,6 +151,8 @@ class GetItem(ItemTest): self.assertIn('wrapper-xblock', html) self.assertRegexpMatches( html, + # The instance of the wrapper class will have an auto-generated ID (wrapperxxx). Allow anything + # for the 3 characters after wrapper. (r'"/container/MITx.999.Robot_Super_Course/branch/published/block/wrapper.{3}" class="action-button">\s*' 'View') ) diff --git a/cms/templates/container.html b/cms/templates/container.html index 076d9c5649..83855250ed 100644 --- a/cms/templates/container.html +++ b/cms/templates/container.html @@ -47,13 +47,13 @@ xblock_info = {

- % for parent in parent_xblocks: + % for ancestor in ancestor_xblocks: <% - parent_url = xblock_studio_url(parent, context_course) + ancestor_url = xblock_studio_url(ancestor, context_course) %> - % if parent_url: - ${parent.display_name_with_default | h} + % if ancestor_url: + ${ancestor.display_name_with_default | h} % endif % endfor ${xblock.display_name_with_default | h}