{% load static %}
<!-- Wagtail user bar embed code -->
<script type="text/javascript">
    var wagtail = wagtail || {};
    wagtail.static_root = '{% static "wagtailadmin/" %}';
    wagtail.userbar = {
        src: '{% if revision_id %}{% url "wagtailadmin_userbar_moderation" revision_id %}{% else %}{% url "wagtailadmin_userbar_frontend" page.self.id %}{% endif %}',
        origin:'{% if request.is_secure %}https{% else %}http{% endif %}://{{ request.get_host }}'
    };
    (function(d) {
        var u = d.createElement('script'); u.type = 'text/javascript'; u.async = true;
        u.src = '{% static "wagtailadmin/js/userbar_embed.js" %}';
        var s = d.getElementsByTagName('script')[0]; s.parentNode.insertBefore(u, s);
    })(document);
</script>
<!-- end Wagtail user bar embed code -->