From 6812490dd5c0d040cc4478f7f09a77b128fb621c Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 2 Apr 2013 02:11:14 -0400 Subject: added extra context to the questions page and to the question summary snippet --- askbot/models/question.py | 2 ++ askbot/views/readers.py | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/askbot/models/question.py b/askbot/models/question.py index 455b0845..c772804a 100644 --- a/askbot/models/question.py +++ b/askbot/models/question.py @@ -1410,6 +1410,8 @@ class Thread(models.Model): 'search_state': DummySearchState(), 'visitor': visitor } + from askbot.views.context import get_extra as get_extra_context + context.update(get_extra_context('ASKBOT_QUESTION_SUMMARY_EXTRA_CONTEXT', None, context)) html = get_template('widgets/question_summary.html').render(context) # INFO: Timeout is set to 30 days: # * timeout=0/None is not a reliable cross-backend way to set infinite timeout diff --git a/askbot/views/readers.py b/askbot/views/readers.py index fc74c739..962e1dbb 100644 --- a/askbot/views/readers.py +++ b/askbot/views/readers.py @@ -238,6 +238,13 @@ def questions(request, **kwargs): 'feed_url': context_feed_url, } + extra_context = context.get_extra( + 'ASKBOT_QUESTIONS_PAGE_EXTRA_CONTEXT', + request, + template_data + ) + template_data.update(extra_context) + return render(request, 'main_page.html', template_data) -- cgit v1.2.3-1-g7c22