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
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)
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)
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)
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)
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)
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)
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)
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
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