- (_('active'), pagination.SimpleSort(_('active'), '-last_activity_at', _("most recently updated questions"))),
- (_('newest'), pagination.SimpleSort(_('newest'), '-added_at', _("most recently asked questions"))),
- (_('hottest'), pagination.SimpleSort(_('hottest'), '-extra_count', _("hottest questions"))),
- (_('mostvoted'), pagination.SimpleSort(_('most voted'), '-score', _("most voted questions"))),
- ), pagesizes=(15, 30, 50), default_pagesize=default_pagesize, prefix=prefix)
+ (_('active'), pagination.SimpleSort(_('active'), '-last_activity_at', _("Most <strong>recently updated</strong> questions"))),
+ (_('newest'), pagination.SimpleSort(_('newest'), '-added_at', _("most <strong>recently asked</strong> questions"))),
+ (_('hottest'), HottestQuestionsSort(_('hottest'), _("most <strong>active</strong> questions in the last 24 hours</strong>"))),
+ (_('mostvoted'), pagination.SimpleSort(_('most voted'), '-score', _("most <strong>voted</strong> questions"))),
+ ), pagesizes=pagesizes, default_pagesize=default_pagesize, prefix=prefix)
+
+class AnswerSort(pagination.SimpleSort):
+ def apply(self, answers):
+ if not settings.DISABLE_ACCEPTING_FEATURE:
+ return answers.order_by(*(['-marked'] + list(self._get_order_by())))
+ else:
+ return super(AnswerSort, self).apply(answers)