示例#1
0
 def get_context_data(self, **kwargs):
     context = super(CategoryListView, self).get_context_data(**kwargs)
     context.update(categorylistview.get_category_context(self.request))
     context.update({
         'view_type': 'CategoryListView',
         'staging_server': STAGING_SERVER,
     })
     context = seo.SEOMetaTags(context).get_meta_tags()
     return context
示例#2
0
def index(request):
    topics = taxonomy_helper.get_top_level_cats()
    context = {
        'topics': topics,
        'view_type': 'Index',
        'index_page': True,
        'staging_server': STAGING_SERVER,
    }
    context = seo.SEOMetaTags(context).get_meta_tags()
    return render(request, 'fooreviews/index.html', context)
示例#3
0
def contact(request):
    context = {}
    fd = fdp.FormDataProcessor(request)
    context = fd.process_data()
    context.update({
        'title': '',
        'view_type': 'Contact Us',
        'template_type': 'contact_us',
    })
    context = seo.SEOMetaTags(context).get_meta_tags()
    return render(request, 'fooreviews/about.html', context)
示例#4
0
def reviews(request):

    context = topical_reviews.get_context(request)
    context.update({
        'frsku': True,
        'view_type': 'TopicalReviews',
        'staging_server': STAGING_SERVER,
        'metadata_page': False,
    })
    context = seo.SEOMetaTags(context).get_meta_tags()
    return render(request, 'fooreviews/topical_reviews.html', context)
示例#5
0
def terms(request):
    content = models.AboutLegal.objects.filter(content_type='Terms of Use')[0]
    context = {
        'content': content,
        'view_type': 'Terms',
        'template_type': 'terms',
        'staging_server': STAGING_SERVER,
        'title': 'Terms of Use ("Terms")'
    }
    context = seo.SEOMetaTags(context).get_meta_tags()
    return render(request, 'fooreviews/legal.html', context)
示例#6
0
def about(request):
    content = models.AboutLegal.objects.filter(content_type='About')[0]
    context = {
        'content': content,
        'view_type': 'About',
        'template_type': 'about',
        'staging_server': STAGING_SERVER,
        'title': 'About Fooreviews'
    }
    context = seo.SEOMetaTags(context).get_meta_tags()
    return render(request, 'fooreviews/about.html', context)
示例#7
0
def privacy(request):
    content = models.AboutLegal.objects.filter(
        content_type='Privacy Policy')[0]
    context = {
        'content': content,
        'view_type': 'Privacy',
        'template_type': 'privacy',
        'staging_server': STAGING_SERVER,
        'title': 'Privacy Policy'
    }
    context = seo.SEOMetaTags(context).get_meta_tags()
    return render(request, 'fooreviews/legal.html', context)
示例#8
0
def data_interpretation(request):
    content = models.AboutLegal.objects.filter(
        content_type='Data Interpretation')[0]
    context = {
        'content': content,
        'view_type': 'Interpretation',
        'template_type': 'interpretation',
        'staging_server': STAGING_SERVER,
        'title': 'Data Interpretation'
    }
    context = seo.SEOMetaTags(context).get_meta_tags()
    return render(request, 'fooreviews/interpretation.html', context)
示例#9
0
 def get_context_data(self, **kwargs):
     '''
     Get an article object if status=published. Otherwise, raise
     404.
     '''
     article_obj = super(ArticleDetailView, self).get_object()
     if article_obj.published:
         context = detailview.get_context(self.request, article_obj)
         context.update({
             'view_type': 'DetailView',
             'staging_server': STAGING_SERVER,
         })
         context = seo.SEOMetaTags(context).get_meta_tags()
         return context
     else:
         raise Http404
示例#10
0
 def get_context_data(self, **kwargs):
     context = super(SearchListView, self).get_context_data(**kwargs)
     context.update(searchlistview.search(self.request))
     context.update({'view_type': 'SearchListView'})
     context = seo.SEOMetaTags(context).get_meta_tags()
     return context