@register.inclusion_tag("includes/editable_loader.html", takes_context=True)
def editable_loader(context):
    user = context["request"].user
    template_vars = {
        "has_site_permission": has_site_permission(user),
        "request": context["request"],
    }
    if (settings.INLINE_EDITING_ENABLED and
            template_vars["has_site_permission"]):
        t = get_template("includes/editable_toolbar.html")
        template_vars["REDIRECT_FIELD_NAME"] = REDIRECT_FIELD_NAME
        template_vars["editable_obj"] = context.get("editable_obj",
                                        context.get("page", None))
        template_vars["accounts_logout_url"] = context.get(
            "accounts_logout_url", None)
        template_vars["toolbar"] = t.render(Context(template_vars))
        template_vars["richtext_media"] = RichTextField().formfield(
            ).widget.media
    return template_vars
Set up the required JS/CSS for the in-line editing toolbar and controls.
dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/core/templatetags/mezzanine_tags.py/editable_loader