From e216bb9eb8ee5ce1ec1a0362a06cc05923539089 Mon Sep 17 00:00:00 2001 From: gfawcett Date: Wed, 20 Apr 2011 02:58:47 +0000 Subject: [PATCH] add an "All Courses" option to the timeframe menu, for those who don't like it/get it. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@1406 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/syrup/models.py | 2 ++ conifer/templates/components/timeframe.xhtml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/conifer/syrup/models.py b/conifer/syrup/models.py index dc92076..920d3fa 100644 --- a/conifer/syrup/models.py +++ b/conifer/syrup/models.py @@ -221,6 +221,8 @@ class Term(BaseModel): return Q(start_term__start__lte=after, start_term__start__gt=today) elif N == 2: # all future courses return Q(start_term__start__gt=today) + elif N == 99: # no filter at all + return Q() else: raise Exception('unknown timeframe: %d' % N) diff --git a/conifer/templates/components/timeframe.xhtml b/conifer/templates/components/timeframe.xhtml index c32c282..993ef92 100644 --- a/conifer/templates/components/timeframe.xhtml +++ b/conifer/templates/components/timeframe.xhtml @@ -15,6 +15,8 @@ ${opt( 0, _('Active courses'), True)} ${opt( 1, _('Starting soon'))} ${opt( 2, _('Future courses'))} + ${opt( 99, _('——'), True)} + ${opt( 99, _('All courses'))}