'set up for buttons in upper right corner of main page.'

def corner_buttons(self):

    buttons = []
    if c.user_is_loggedin:
        if (c.user.name in g.admins):
            if c.user_is_admin:
                buttons += [OffsiteButton(_('turn    admin    off'), dest=('%s/adminoff?dest=%s' % (g.https_endpoint, quote(request.fullpath))), target='_self')]
            else:
                buttons += [OffsiteButton(_('turn    admin    on'), dest=('%s/adminon?dest=%s' % (g.https_endpoint, quote(request.fullpath))), target='_self')]
        buttons += [NamedButton('prefs', False, css_class='pref-lang')]
    else:
        lang = (c.lang.split('-')[0] if c.lang else '')
        lang_name = (g.lang_name.get(lang) or [lang, ''])
        lang_name = ''.join(lang_name)
        buttons += [JsButton(lang_name, onclick='return    showlang();', css_class='pref-lang')]
    return NavMenu(buttons, base_path='/', type='flatlist')
