@register.simple_tag
def domains_menu(selection, user, ajax_mode=True):
    domain_list_url = (
        "list/" if ajax_mode else reverse("admin:domain_list")
    )
    entries = [
        {"name": "domains",
         "label": _("List domains"),
         "img": "fa fa-user",
         "class": "ajaxnav navigation",
         "url": domain_list_url},
        {"name": "statistics",
         "label": _("Statistics"),
         "img": "fa fa-line-chart",
         "class": "navigation",
         "url": reverse("admin:domain_statistics")}
    ]
    if user.has_perm("admin.add_domain"):
        entries += [
            {"name": "newdomain",
             "label": _("Add domain"),
             "img": "fa fa-plus",
             "modal": True,
             "modalcb": "admin.newdomain_cb",
             "url": reverse("admin:domain_add")},
        ]
        entries += events.raiseQueryEvent("ExtraDomainMenuEntries", user)
        entries += [
            {"name": "import",
             "label": _("Import"),
             "img": "fa fa-folder-open",
             "url": reverse("admin:domain_import"),
             "modal": True,
             "modalcb": "admin.importform_cb"},
            {"name": "export",
             "label": _("Export"),
             "img": "fa fa-share-alt",
             "url": reverse("admin:domain_export"),
             "modal": True,
             "modalcb": "admin.exportform_cb"}
        ]

    return render_to_string('common/menulist.html', {
        "entries": entries,
        "selection": selection,
        "user": user
    })
Restricted version of upload
dataset/ETHPy150Open tonioo/modoboa/modoboa/admin/templatetags/admin_tags.py/domains_menu--crossover with--dataset/ETHPy150Open spotify/luigi/luigi/contrib/hdfs/webhdfs_client.py/WebHdfsClient.put