@register.inclusion_tag("waliki/box.html", takes_context=True)
def waliki_box(context, slug, show_edit=True, *args, **kwargs):

    request = context["request"]
    try:
        page = Page.objects.get(slug=slug)
    except Page.DoesNotExist:
        page = None

    if (page and check_perms_helper('change_page', request.user, slug)
            or (not page and check_perms_helper('add_page', request.user, slug))):
        form = PageForm(instance=page, initial={'slug': slug})
        form_action = reverse("waliki_edit", args=[slug])
    else:
        form = None
        form_action = None

    return {
        "request": request,
        "slug": slug,
        "label": slug.replace('/', '_'),
        "page": page,
        "form": form,
        "form_action": form_action,
    }
This module has no external dependencies
dataset/ETHPy150Open mgaitan/waliki/waliki/templatetags/waliki_tags.py/waliki_box--crossover with--dataset/ETHPy150Open saltstack/salt/salt/sdb/vault.py/__virtual__