Skip to content

Commit 3a6db15

Browse files
author
Richard Jones
committed
[SF#516854] "My Issues" and redisplay
1 parent 268d54f commit 3a6db15

File tree

5 files changed

+41
-24
lines changed

5 files changed

+41
-24
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Fixed:
2222
. All forms now have "double-submit" protection when Javascript is enabled
2323
on the client-side.
2424
. #516883 ] mail interface + ANONYMOUS_REGISTER
25+
. #516854 ] "My Issues" and redisplay
2526

2627

2728
2002-01-24 - 0.4.0

roundup/backends/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: __init__.py,v 1.10 2002-01-22 07:08:50 richard Exp $
18+
# $Id: __init__.py,v 1.11 2002-02-16 08:39:42 richard Exp $
1919

2020
__all__ = []
2121

@@ -31,7 +31,7 @@
3131
anydbm = back_anydbm
3232
__all__.append('anydbm')
3333
except AssertionError:
34-
del back_anydbm
34+
pass
3535
except ImportError:
3636
pass
3737

@@ -51,6 +51,10 @@
5151

5252
#
5353
# $Log: not supported by cvs2svn $
54+
# Revision 1.10 2002/01/22 07:08:50 richard
55+
# I was certain I'd already done this (there's even a change note in
56+
# CHANGES)...
57+
#
5458
# Revision 1.9 2001/12/12 02:30:51 richard
5559
# I fixed the problems with people whose anydbm was using the dbm module at the
5660
# backend. It turns out the dbm module modifies the file name to append ".db"

roundup/htmltemplate.py

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: htmltemplate.py,v 1.73 2002-02-15 07:08:44 richard Exp $
18+
# $Id: htmltemplate.py,v 1.74 2002-02-16 08:39:42 richard Exp $
1919

2020
__doc__ = """
2121
Template engine.
2222
"""
2323

24-
import os, re, StringIO, urllib, cgi, errno
24+
import os, re, StringIO, urllib, cgi, errno, types
2525

2626
import hyperdb, date, password
2727
from i18n import _
@@ -257,20 +257,17 @@ def do_menu(self, property, size=None, height=None, showid=0):
257257
value = self.determine_value(property)
258258

259259
# display
260-
if isinstance(propclass, hyperdb.Link):
260+
if isinstance(propclass, hyperdb.Multilink):
261261
linkcl = self.db.classes[propclass.classname]
262-
l = ['<select name="%s">'%property]
263-
k = linkcl.labelprop()
264-
s = ''
265-
if value is None:
266-
s = 'selected '
267-
l.append(_('<option %svalue="-1">- no selection -</option>')%s)
268262
options = linkcl.list()
269263
options.sort(sortfunc)
264+
height = height or min(len(options), 7)
265+
l = ['<select multiple name="%s" size="%s">'%(property, height)]
266+
k = linkcl.labelprop()
270267
for optionid in options:
271268
option = linkcl.get(optionid, k)
272269
s = ''
273-
if optionid == value:
270+
if optionid in value:
274271
s = 'selected '
275272
if showid:
276273
lab = '%s%s: %s'%(propclass.classname, optionid, option)
@@ -279,20 +276,27 @@ def do_menu(self, property, size=None, height=None, showid=0):
279276
if size is not None and len(lab) > size:
280277
lab = lab[:size-3] + '...'
281278
lab = cgi.escape(lab)
282-
l.append('<option %svalue="%s">%s</option>'%(s, optionid, lab))
279+
l.append('<option %svalue="%s">%s</option>'%(s, optionid,
280+
lab))
283281
l.append('</select>')
284282
return '\n'.join(l)
285-
if isinstance(propclass, hyperdb.Multilink):
283+
if isinstance(propclass, hyperdb.Link):
284+
# force the value to be a single choice
285+
if type(value) is types.ListType:
286+
value = value[0]
286287
linkcl = self.db.classes[propclass.classname]
288+
l = ['<select name="%s">'%property]
289+
k = linkcl.labelprop()
290+
s = ''
291+
if value is None:
292+
s = 'selected '
293+
l.append(_('<option %svalue="-1">- no selection -</option>')%s)
287294
options = linkcl.list()
288295
options.sort(sortfunc)
289-
height = height or min(len(options), 7)
290-
l = ['<select multiple name="%s" size="%s">'%(property, height)]
291-
k = linkcl.labelprop()
292296
for optionid in options:
293297
option = linkcl.get(optionid, k)
294298
s = ''
295-
if optionid in value:
299+
if optionid == value:
296300
s = 'selected '
297301
if showid:
298302
lab = '%s%s: %s'%(propclass.classname, optionid, option)
@@ -301,8 +305,7 @@ def do_menu(self, property, size=None, height=None, showid=0):
301305
if size is not None and len(lab) > size:
302306
lab = lab[:size-3] + '...'
303307
lab = cgi.escape(lab)
304-
l.append('<option %svalue="%s">%s</option>'%(s, optionid,
305-
lab))
308+
l.append('<option %svalue="%s">%s</option>'%(s, optionid, lab))
306309
l.append('</select>')
307310
return '\n'.join(l)
308311
return _('[Menu: not a link]')
@@ -768,7 +771,8 @@ def render(self, filterspec={}, filter=[], columns=[], sort=[], group=[],
768771
for nodeid in nodeids:
769772
# check for a group heading
770773
if group_names:
771-
this_group = [self.cl.get(nodeid, name, _('[no value]')) for name in group_names]
774+
this_group = [self.cl.get(nodeid, name, _('[no value]'))
775+
for name in group_names]
772776
if this_group != old_group:
773777
l = []
774778
for name in group_names:
@@ -1064,6 +1068,10 @@ def render(self, form):
10641068

10651069
#
10661070
# $Log: not supported by cvs2svn $
1071+
# Revision 1.73 2002/02/15 07:08:44 richard
1072+
# . Alternate email addresses are now available for users. See the MIGRATION
1073+
# file for info on how to activate the feature.
1074+
#
10671075
# Revision 1.72 2002/02/14 23:39:18 richard
10681076
# . All forms now have "double-submit" protection when Javascript is enabled
10691077
# on the client-side.

roundup/templates/classic/html/issue.filter

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Id: issue.filter,v 1.2 2001-07-29 04:07:37 richard Exp $-->
1+
<!-- $Id: issue.filter,v 1.3 2002-02-16 08:39:42 richard Exp $-->
22
<property name="title">
33
<tr><th width="1%" align="right" class="location-bar">Title</th>
44
<td><display call="field('title')"></td></tr>
@@ -11,3 +11,7 @@
1111
<tr><th width="1%" align="right" class="location-bar">Priority</th>
1212
<td><display call="checklist('priority')"></td></tr>
1313
</property>
14+
<property name="assignedto">
15+
<tr><th width="1%" align="right" class="location-bar">Assigned&nbsp;to</th>
16+
<td><display call="field('assignedto')"></td></tr>
17+
</property>

roundup/templates/extended/html/issue.filter

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Id: issue.filter,v 1.2 2001-07-30 01:26:59 richard Exp $-->
1+
<!-- $Id: issue.filter,v 1.3 2002-02-16 08:39:43 richard Exp $-->
22
<property name="title">
33
<tr><th width="1%" align="right" class="location-bar">Title</th>
44
<td><display call="field('title')"></td></tr>
@@ -25,5 +25,5 @@
2525
</property>
2626
<property name="assignedto">
2727
<tr><th width="1%" align="right" class="location-bar">Assigned&nbsp;to</th>
28-
<td><display call="checklist('assignedto')"></td></tr>
28+
<td><display call="menu('assignedto')"></td></tr>
2929
</property>

0 commit comments

Comments
 (0)