#NEWLINE# def home( request ) : #NEWLINE# #INDENT# 'Community hub landing page.' #NEWLINE# community_news = get_object_fallback ( Document , COMMUNITY_NEWS_DOC , request . LANGUAGE_CODE ) #NEWLINE# locale = _validate_locale ( request . GET . get ( 'locale' ) ) #NEWLINE# product = request . GET . get ( 'product' ) #NEWLINE# if product : #NEWLINE# #INDENT# product = get_object_or_404 ( Product , slug = product ) #NEWLINE# #UNINDENT# recent_threads = Thread . objects . filter ( forum__slug = 'contributors' ) [ : 5 ] #NEWLINE# data = { #NEWLINE# #INDENT# 'community_news' : community_news , #NEWLINE# 'locale' : locale , #NEWLINE# 'product' : product , #NEWLINE# 'products' : Product . objects . filter ( visible = True ) , #NEWLINE# 'threads' : recent_threads , #NEWLINE# #UNINDENT# } #NEWLINE# if locale : #NEWLINE# #INDENT# ( data [ 'top_contributors_aoa' ] , _ ) = top_contributors_aoa ( locale = locale ) #NEWLINE# if ( locale == settings . WIKI_DEFAULT_LANGUAGE ) : #NEWLINE# #INDENT# ( data [ 'top_contributors_kb' ] , _ ) = top_contributors_kb ( product = product ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( data [ 'top_contributors_l10n' ] , _ ) = top_contributors_l10n ( locale = locale , product = product ) #NEWLINE# #UNINDENT# if ( _ in QuestionLocale . objects . locales_list ( ) ) : #NEWLINE# #INDENT# ( data [ 'top_contributors_questions' ] , _ ) = top_contributors_questions ( locale = locale , product = product ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# ( data [ 'top_contributors_aoa' ] , _ ) = top_contributors_aoa ( ) #NEWLINE# ( data [ 'top_contributors_kb' ] , _ ) = top_contributors_kb ( product = product ) #NEWLINE# ( data [ 'top_contributors_l10n' ] , _ ) = top_contributors_l10n ( product = product ) #NEWLINE# ( data [ 'top_contributors_questions' ] , _ ) = top_contributors_questions ( product = product ) #NEWLINE# #UNINDENT# return render ( request , 'community/index.html' , data )