@register.inclusion_tag(u'includes/editable_loader.html', takes_context=True)
def editable_loader(context):
 user = context[u'request'].user
 template_vars = {u'has_site_permission': has_site_permission(user), u'request': context[u'request']}
 if (settings.INLINE_EDITING_ENABLED and template_vars[u'has_site_permission']):
  t = get_template(u'includes/editable_toolbar.html')
  template_vars[u'REDIRECT_FIELD_NAME'] = REDIRECT_FIELD_NAME
  template_vars[u'editable_obj'] = context.get(u'editable_obj', context.get(u'page', None))
  template_vars[u'accounts_logout_url'] = context.get(u'accounts_logout_url', None)
  template_vars[u'toolbar'] = t.render(Context(template_vars))
  template_vars[u'richtext_media'] = RichTextField().formfield().widget.media
 return template_vars

@ register . inclusion_tag ( u'includes/editable_loader.html' , takes_context = True ) def editable_loader ( context ) : user = context [ u'request' ] . user template_vars = { u'has_site_permission' : has_site_permission ( user ) , u'request' : context [ u'request' ] } if ( settings . INLINE_EDITING_ENABLED and template_vars [ u'has_site_permission' ] ) : t = get_template ( u'includes/editable_toolbar.html' ) template_vars [ u'REDIRECT_FIELD_NAME' ] = REDIRECT_FIELD_NAME template_vars [ u'editable_obj' ] = context . get ( u'editable_obj' , context . get ( u'page' , None ) ) template_vars [ u'accounts_logout_url' ] = context . get ( u'accounts_logout_url' , None ) template_vars [ u'toolbar' ] = t . render ( Context ( template_vars ) ) template_vars [ u'richtext_media' ] = RichTextField ( ) . formfield ( ) . widget . media return template_vars
set up the required js/css for the in-line editing toolbar and controls .