@check_simple_wiki_locale
@mobile_template('products/{mobile/}documents.html')
def document_listing(request, template, product_slug, topic_slug, subtopic_slug=None):
 product = get_object_or_404(Product, slug=product_slug)
 topic = get_object_or_404(Topic, slug=topic_slug, product=product, parent__isnull=True)
 doc_kw = {'locale': request.LANGUAGE_CODE, 'products': [product]}
 if (subtopic_slug is not None):
  subtopic = get_object_or_404(Topic, slug=subtopic_slug, product=product, parent=topic)
  doc_kw['topics'] = [subtopic]
 else:
  subtopic = None
  doc_kw['topics'] = [topic]
 (documents, fallback_documents) = documents_for(**doc_kw)
 user_agent = request.META.get('HTTP_USER_AGENT', '')
 browser = get_browser(user_agent)
 show_fx_download = ((product.slug == 'thunderbird') and (browser != 'Firefox'))
 return render(request, template, {'product': product, 'topic': topic, 'subtopic': subtopic, 'topics': topics_for(product=product, parent=None), 'subtopics': topics_for(product=product, parent=topic), 'documents': documents, 'fallback_documents': fallback_documents, 'search_params': {'product': product_slug}, 'show_fx_download': show_fx_download})

@ check_simple_wiki_locale @ mobile_template ( 'products/{mobile/}documents.html' ) def document_listing ( request , template , product_slug , topic_slug , subtopic_slug = None ) : product = get_object_or_404 ( Product , slug = product_slug ) topic = get_object_or_404 ( Topic , slug = topic_slug , product = product , parent__isnull = True ) doc_kw = { 'locale' : request . LANGUAGE_CODE , 'products' : [ product ] } if ( subtopic_slug is not None ) : subtopic = get_object_or_404 ( Topic , slug = subtopic_slug , product = product , parent = topic ) doc_kw [ 'topics' ] = [ subtopic ] else : subtopic = None doc_kw [ 'topics' ] = [ topic ] ( documents , fallback_documents ) = documents_for ( ** doc_kw ) user_agent = request . META . get ( 'HTTP_USER_AGENT' , '' ) browser = get_browser ( user_agent ) show_fx_download = ( ( product . slug == 'thunderbird' ) and ( browser != 'Firefox' ) ) return render ( request , template , { 'product' : product , 'topic' : topic , 'subtopic' : subtopic , 'topics' : topics_for ( product = product , parent = None ) , 'subtopics' : topics_for ( product = product , parent = topic ) , 'documents' : documents , 'fallback_documents' : fallback_documents , 'search_params' : { 'product' : product_slug } , 'show_fx_download' : show_fx_download } )
the document listing page for a product + topic .