'Preference page'

@disable_subreddit_css()
@validate(VUser(), location=nop('location'), verified=VBoolean('verified'))
def GET_prefs(self, location='', verified=False):

    content = None
    infotext = None
    if ((not location) or (location == 'options')):
        content = PrefOptions(done=request.GET.get('done'), error_style_override=request.GET.get('error_style_override'), generic_error=request.GET.get('generic_error'))
    elif (location == 'update'):
        if verified:
            infotext = strings.email_verified
        content = PrefUpdate()
    elif (location == 'apps'):
        content = PrefApps(my_apps=OAuth2Client._by_user_grouped(c.user), developed_apps=OAuth2Client._by_developer(c.user))
    elif ((location == 'feeds') and c.user.pref_private_feeds):
        content = PrefFeeds()
    elif (location == 'deactivate'):
        content = PrefDeactivate()
    elif (location == 'delete'):
        return self.redirect('/prefs/deactivate', code=301)
    elif (location == 'security'):
        if (c.user.name not in g.admins):
            return self.redirect('/prefs/')
        content = PrefSecurity()
    else:
        return self.abort404()
    return PrefsPage(content=content, infotext=infotext).render()
