@register.simple_tag
def identities_menu(user, selection=None):
    entries = [
        {"name": "identities",
         "label": _("List identities"),
         "img": "fa fa-user",
         "class": "ajaxnav navigation",
         "url": "list/"},
        {"name": "quotas",
         "label": _("List quotas"),
         "img": "fa fa-hdd-o",
         "class": "ajaxnav navigation",
         "url": "quotas/"},
        {"name": "newaccount",
         "label": _("Add account"),
         "img": "fa fa-plus",
         "modal": True,
         "modalcb": "admin.newaccount_cb",
         "url": reverse("admin:account_add")},
        {"name": "newalias",
         "label": _("Add alias"),
         "img": "fa fa-plus",
         "modal": True,
         "modalcb": "admin.aliasform_cb",
         "url": reverse("admin:alias_add")},
        {"name": "newforward",
         "label": _("Add forward"),
         "img": "fa fa-plus",
         "modal": True,
         "modalcb": "admin.aliasform_cb",
         "url": reverse("admin:forward_add")},
        {"name": "newdlist",
         "label": _("Add distribution list"),
         "img": "fa fa-plus",
         "modal": True,
         "modalcb": "admin.aliasform_cb",
         "url": reverse("admin:dlist_add")},
        {"name": "import",
         "label": _("Import"),
         "img": "fa fa-folder-open",
         "url": reverse("admin:identity_import"),
         "modal": True,
         "modalcb": "admin.importform_cb"},
        {"name": "export",
         "label": _("Export"),
         "img": "fa fa-share-alt",
         "url": reverse("admin:identity_export"),
         "modal": True,
         "modalcb": "admin.exportform_cb"
         }
    ]

    return render_to_string('common/menulist.html', {
        "entries": entries,
        "user": user
    })
Menu specific to the Identities page.
dataset/ETHPy150Open tonioo/modoboa/modoboa/admin/templatetags/admin_tags.py/identities_menu