def menu_links(request):
    """
    Helper for determining active menu
    """
    links = []
    if request.user.is_authenticated():
        links += [
            ['Add expense', '/add/', ''],
            ['Show expenses', '/expenses/', ''],
            ['Dashboard', '/dashboard/', ''],
        ]

    for link in links:
        if link[1] in request.path:
            link[2] = 'active'
            break
    return {'links': links}