def _studio_wrap_xblock(xblock, view, frag, context, display_name_only=False):
 if ((not context.get('is_pages_view', None)) and (view in PREVIEW_VIEWS)):
  root_xblock = context.get('root_xblock')
  is_root = (root_xblock and (xblock.location == root_xblock.location))
  is_reorderable = _is_xblock_reorderable(xblock, context)
  template_context = {'xblock_context': context, 'xblock': xblock, 'show_preview': context.get('show_preview', True), 'content': frag.content, 'is_root': is_root, 'is_reorderable': is_reorderable, 'can_edit': context.get('can_edit', True), 'can_edit_visibility': context.get('can_edit_visibility', True), 'can_add': context.get('can_add', True)}
  html = render_to_string('studio_xblock_wrapper.html', template_context)
  frag = wrap_fragment(frag, html)
 return frag

def _studio_wrap_xblock ( xblock , view , frag , context , display_name_only = False ) : if ( ( not context . get ( 'is_pages_view' , None ) ) and ( view in PREVIEW_VIEWS ) ) : root_xblock = context . get ( 'root_xblock' ) is_root = ( root_xblock and ( xblock . location == root_xblock . location ) ) is_reorderable = _is_xblock_reorderable ( xblock , context ) template_context = { 'xblock_context' : context , 'xblock' : xblock , 'show_preview' : context . get ( 'show_preview' , True ) , 'content' : frag . content , 'is_root' : is_root , 'is_reorderable' : is_reorderable , 'can_edit' : context . get ( 'can_edit' , True ) , 'can_edit_visibility' : context . get ( 'can_edit_visibility' , True ) , 'can_add' : context . get ( 'can_add' , True ) } html = render_to_string ( 'studio_xblock_wrapper.html' , template_context ) frag = wrap_fragment ( frag , html ) return frag
wraps the results of rendering an xblock view in a div which adds a header and studio action buttons .