From a1dba6094df1d2bd524eae9bc1ab80024a75ae42 Mon Sep 17 00:00:00 2001 From: qw3rty Date: Wed, 16 Jun 2010 16:13:22 +0000 Subject: [PATCH] OSQA-263 The titles of the question lists should make more since now. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@431 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- .../templates/question_list/title.html | 6 ++++- forum/views/readers.py | 24 ++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/forum/skins/default/templates/question_list/title.html b/forum/skins/default/templates/question_list/title.html index 00934b4..bb6268f 100644 --- a/forum/skins/default/templates/question_list/title.html +++ b/forum/skins/default/templates/question_list/title.html @@ -14,7 +14,11 @@ {% if is_unanswered %} {% trans "Unanswered questions" %} {% else %} - {% trans "All questions" %} + {% if page_title %} + {% trans page_title %} + {% else %} + {% trans "All Questions" %} + {% endif %} {% endif %} {% endif %} {% endif %} diff --git a/forum/views/readers.py b/forum/views/readers.py index 32aedec..b5692fa 100644 --- a/forum/views/readers.py +++ b/forum/views/readers.py @@ -1,4 +1,4 @@ -# encoding:utf-8 +# encoding:utf-8 import datetime import logging from urllib import unquote @@ -45,8 +45,8 @@ ANSWERS_PAGE_SIZE = 10 def index(request): return question_list(request, Question.objects.all(), - sort=request.utils.set_sort_method('active'), - base_path=reverse('questions')) + request.utils.set_sort_method('active'), + reverse('questions')) @decorators.render('questions.html', 'unanswered') def unanswered(request): @@ -55,7 +55,7 @@ def unanswered(request): _('open questions without an accepted answer'), request.utils.set_sort_method('active'), None, - _("Unanswered questions")) + _("Unanswered Questions")) @decorators.render('questions.html', 'questions') def questions(request): @@ -68,12 +68,17 @@ def tag(request, tag): mark_safe(_('questions tagged %(tag)s') % {'tag': tag}), request.utils.set_sort_method('active'), None, - mark_safe(_('questions tagged %(tag)s') % {'tag': tag}), + mark_safe(_('Questions Tagged With %(tag)s') % {'tag': tag}), False) @decorators.list('questions', QUESTIONS_PAGE_SIZE) -def question_list(request, initial, list_description=_('questions'), sort=None, base_path=None, page_title=None, +def question_list(request, initial, + list_description=_('questions'), + sort=None, + base_path=None, + page_title=_("All Question"), allowIgnoreTags=True): + questions = initial.filter_state(deleted=False) if request.user.is_authenticated() and allowIgnoreTags: @@ -134,8 +139,11 @@ def search(request): def question_search(request, keywords): initial = Question.objects.search(keywords) - return question_list(request, initial, _("questions matching '%(keywords)s'") % {'keywords': keywords}, - base_path="%s?t=question&q=%s" % (reverse('search'), django_urlquote(keywords)), sort=False) + return question_list(request, initial, + _("questions matching '%(keywords)s'") % {'keywords': keywords}, + False, + "%s?t=question&q=%s" % (reverse('search'),django_urlquote(keywords)), + _("questions matching '%(keywords)s'") % {'keywords': keywords}) def tags(request):#view showing a listing of available tags - plain list -- 2.39.5