Introduce constants for studio_view, student_view, and author_view.
This commit is contained in:
@@ -15,7 +15,7 @@ from xblock.fragment import Fragment
|
||||
|
||||
from xmodule.seq_module import SequenceModule
|
||||
from xmodule.vertical_module import VerticalModule
|
||||
from xmodule.x_module import shim_xmodule_js, XModuleDescriptor, XModule
|
||||
from xmodule.x_module import shim_xmodule_js, XModuleDescriptor, XModule, PREVIEW_VIEWS, STUDIO_VIEW
|
||||
from xmodule.modulestore import MONGO_MODULESTORE_TYPE
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
@@ -59,10 +59,10 @@ def wrap_xblock(runtime_class, block, view, frag, context, usage_id_serializer,
|
||||
css_classes = ['xblock', 'xblock-' + view]
|
||||
|
||||
if isinstance(block, (XModule, XModuleDescriptor)):
|
||||
if view in ['student_view', 'author_view']:
|
||||
if view in PREVIEW_VIEWS:
|
||||
# The block is acting as an XModule
|
||||
css_classes.append('xmodule_display')
|
||||
elif view == 'studio_view':
|
||||
elif view == STUDIO_VIEW:
|
||||
# The block is acting as an XModuleDescriptor
|
||||
css_classes.append('xmodule_edit')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user