Generate ``menu_alt`` with log in/out links.

    :return: HTML fragment
    :rtype: str

def generate_menu_alt():
    """Generate ``menu_alt`` with log in/out links.

    :return: HTML fragment
    :rtype: str
    """
    if not current_user.is_authenticated():
        return ('<li><a href="{0}"><i class="fa fa-fw fa-sign-in"></i> '
                'Log in</a></li>'.format(url_for('login')))
    if db is not None and current_user.is_admin:
        edit_entry = (
            '<li><a href="{0}"><i class="fa fa-fw fa-users"></i> '
            'Manage users</a></li>'
            '<li><a href="{1}"><i class="fa fa-fw fa-cubes"></i> '
            'Permissions</a></li>'.format(
                url_for('acp_users'), url_for('acp_users_permissions')))
    else:
        edit_entry = ''
    return """
    <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown"
            role="button" aria-expanded="false">
            <i class="fa fa-fw fa-user"></i>
            {0} [{1}] <span class="caret"></span></a>
        <ul class="dropdown-menu" role="menu">
            <li><a href="{3}"><i class="fa fa-fw fa-sliders"></i>
            Account</a></li>
            {2}
            <li><a href="{4}"><i class="fa fa-fw fa-sign-out"></i>
            Log out</a></li>
        </ul>
    </li>""".format(current_user.realname, current_user.username, edit_entry,
                    url_for('acp_account'), url_for('logout'))