\r
{% for answer in answers.paginator.page %}\r
<a name="{{ answer.id }}"></a>\r
- <div id="answer-container-{{ answer.id }}" class="answer {% post_classes answer %}">\r
+ <div id="answer-container-{{ answer.id }}" class="answer {% post_classes answer %}{% ifequal answer.id focused_answer_id %} focusedAnswer{% endifequal %}">\r
<table style="width:100%;">\r
<tr>\r
<td style="width:30px;vertical-align:top">\r
if page == 0:
page = 1
- return HttpResponsePermanentRedirect("%s?%s=%s#%s" % (
- answer.question.get_absolute_url(), _('page'), page, answer.id))
+ return HttpResponseRedirect("%s?%s=%s&focusedAnswerId=%s#%s" % (
+ answer.question.get_absolute_url(), _('page'), page, answer.id, answer.id))
@decorators.render("question.html", 'questions')
def question(request, id, slug='', answer=None):
subscription = False
else:
subscription = False
+ try:
+ focused_answer_id = int(request.GET.get("focusedAnswerId", None))
+ except TypeError, ValueError:
+ focused_answer_id = None
return pagination.paginated(request, ('answers', AnswerPaginatorContext()), {
"question" : question,
"similar_questions" : question.get_related_questions(),
"subscription": subscription,
"embed_youtube_videos" : settings.EMBED_YOUTUBE_VIDEOS,
+ "focused_answer_id" : focused_answer_id
})