From 4e0881f14b8a2e1c0187e600041ab8675f54ae3e Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 29 Jul 2001 04:04:00 +0000 Subject: [PATCH] Moved some code around allowing for subclassing to change behaviour. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@123 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi_client.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py index 9e63524..42c9d76 100644 --- a/roundup/cgi_client.py +++ b/roundup/cgi_client.py @@ -1,4 +1,4 @@ -# $Id: cgi_client.py,v 1.5 2001-07-28 08:16:52 richard Exp $ +# $Id: cgi_client.py,v 1.6 2001-07-29 04:04:00 richard Exp $ import os, cgi, pprint, StringIO, urlparse, re, traceback @@ -120,21 +120,27 @@ class Client: filterspec[key] = l return filterspec + + default_index_sort = ['-activity'] + default_index_group = ['priority'] + default_index_filter = [] + default_index_columns = ['activity','status','title'] + default_index_filterspec = {'status': ['1', '2', '3', '4', '5', '6', '7']} def index(self): ''' put up an index ''' self.classname = 'issue' if self.form.has_key(':sort'): sort = self.index_arg(':sort') - else: sort=['-activity'] + else: sort = self.default_index_sort if self.form.has_key(':group'): group = self.index_arg(':group') - else: group=['priority'] + else: group = self.default_index_group if self.form.has_key(':filter'): filter = self.index_arg(':filter') - else: filter = [] + else: filter = self.default_index_filter if self.form.has_key(':columns'): columns = self.index_arg(':columns') - else: columns=['activity','status','title'] + else: columns = self.default_index_columns filterspec = self.index_filterspec() if not filterspec: - filterspec['status'] = ['1', '2', '3', '4', '5', '6', '7'] + filterspec = self.default_index_filterspec return self.list(columns=columns, filter=filter, group=group, sort=sort, filterspec=filterspec) @@ -155,7 +161,7 @@ class Client: ''' cn = self.classname - self.pagehead('Index: %s'%cn) + self.pagehead('Index of %s'%cn) if sort is None: sort = self.index_arg(':sort') if group is None: group = self.index_arg(':group') if filter is None: filter = self.index_arg(':filter') @@ -490,6 +496,9 @@ class Client: # # $Log: not supported by cvs2svn $ +# Revision 1.5 2001/07/28 08:16:52 richard +# New issue form handles lack of note better now. +# # Revision 1.4 2001/07/28 00:34:34 richard # Fixed some non-string node ids. # -- 2.30.2