Skip to content

Commit 854be11

Browse files
author
Richard Jones
committed
Default index now filters out the resolved issues ;)
1 parent 51a4ac5 commit 854be11

File tree

1 file changed

+30
-17
lines changed

1 file changed

+30
-17
lines changed

roundup_cgi.py

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: roundup_cgi.py,v 1.5 2001-07-20 00:17:16 richard Exp $
1+
# $Id: roundup_cgi.py,v 1.6 2001-07-20 00:53:20 richard Exp $
22

33
import os, cgi, pprint, StringIO, urlparse, re, traceback
44

@@ -54,7 +54,7 @@ def pagehead(self, title, message=None):
5454
<tr class="location-bar"><td><big><strong>%s</strong></big></td>
5555
<td align=right valign=bottom>%s</td></tr>
5656
<tr class="location-bar">
57-
<td align=left><a href="issue?:columns=activity,status,title&:group=priority">All issues</a> |
57+
<td align=left><a href="issue?status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=activity,status,title&:group=priority">All issues</a> |
5858
<a href="issue?priority=fatal-bug,bug">Bugs</a> |
5959
<a href="issue?priority=usability">Support</a> |
6060
<a href="issue?priority=feature">Wishlist</a> |
@@ -102,6 +102,23 @@ def index_arg(self, arg):
102102
return arg.value.split(',')
103103
return []
104104

105+
def index_filterspec(self):
106+
''' pull the index filter spec from the form
107+
'''
108+
# all the other form args are filters
109+
filterspec = {}
110+
for key in self.form.keys():
111+
if key[0] == ':': continue
112+
value = self.form[key]
113+
if type(value) == type([]):
114+
value = [arg.value for arg in value]
115+
else:
116+
value = value.value.split(',')
117+
l = filterspec.get(key, [])
118+
l = l + value
119+
filterspec[key] = l
120+
return filterspec
121+
105122
def index(self):
106123
''' put up an index
107124
'''
@@ -114,11 +131,16 @@ def index(self):
114131
else: filter = []
115132
if self.form.has_key(':columns'): columns = self.index_arg(':columns')
116133
else: columns=['activity','status','title']
117-
return self.list(columns=columns, filter=filter, group=group, sort=sort)
134+
filterspec = self.index_filterspec()
135+
if not filterspec:
136+
filterspec['status'] = ['1', '2', '3', '4', '5', '6', '7']
137+
return self.list(columns=columns, filter=filter, group=group,
138+
sort=sort, filterspec=filterspec)
118139

119140
# XXX deviates from spec - loses the '+' (that's a reserved character
120141
# in URLS
121-
def list(self, sort=None, group=None, filter=None, columns=None):
142+
def list(self, sort=None, group=None, filter=None, columns=None,
143+
filterspec=None):
122144
''' call the template index with the args
123145
124146
:sort - sort by prop name, optionally preceeded with '-'
@@ -137,19 +159,7 @@ def list(self, sort=None, group=None, filter=None, columns=None):
137159
if group is None: group = self.index_arg(':group')
138160
if filter is None: filter = self.index_arg(':filter')
139161
if columns is None: columns = self.index_arg(':columns')
140-
141-
# all the other form args are filters
142-
filterspec = {}
143-
for key in self.form.keys():
144-
if key[0] == ':': continue
145-
value = self.form[key]
146-
if type(value) == type([]):
147-
value = [arg.value for arg in value]
148-
else:
149-
value = value.value.split(',')
150-
l = filterspec.get(key, [])
151-
l = l + value
152-
filterspec[key] = l
162+
if filterspec is None: filterspec = self.index_filterspec()
153163

154164
template.index(self, self.db, cn, filterspec, filter, columns, sort,
155165
group)
@@ -478,6 +488,9 @@ def __del__(self):
478488

479489
#
480490
# $Log: not supported by cvs2svn $
491+
# Revision 1.5 2001/07/20 00:17:16 richard
492+
# Fixed adding a new issue when there is no __note
493+
#
481494
# Revision 1.4 2001/07/19 06:27:07 anthonybaxter
482495
# fixing (manually) the (dollarsign)Log(dollarsign) entries caused by
483496
# my using the magic (dollarsign)Id(dollarsign) and (dollarsign)Log(dollarsign)

0 commit comments

Comments
 (0)