Skip to content

Commit 924627b

Browse files
author
Richard Jones
committed
make history() work with new Multilink journal entries
1 parent 9e6750e commit 924627b

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

roundup/template_funcs.py

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# $Id: template_funcs.py,v 1.2 2002-08-15 00:40:10 richard Exp $
2+
# $Id: template_funcs.py,v 1.3 2002-08-19 00:22:47 richard Exp $
33
#
44
import hyperdb, date, password
55
from i18n import _
@@ -618,25 +618,34 @@ def do_history(client, classname, cl, props, nodeid, filterspec,
618618
len(args[k]) > 0:
619619
ml = []
620620
for linkid in args[k]:
621-
label = classname + linkid
622-
# if we have a label property, try to use it
623-
# TODO: test for node existence even when
624-
# there's no labelprop!
625-
try:
626-
if labelprop is not None:
627-
label = linkcl.get(linkid, labelprop)
628-
except IndexError:
629-
comments['no_link'] = _('''<strike>The
630-
linked node no longer
631-
exists</strike>''')
632-
ml.append('<strike>%s</strike>'%label)
621+
if isinstance(linkid, type(())):
622+
sublabel = linkid[0] + ' '
623+
linkids = linkid[1]
633624
else:
634-
if hrefable:
635-
ml.append('<a href="%s%s">%s</a>'%(
636-
classname, linkid, label))
625+
sublabel = ''
626+
linkids = [linkid]
627+
subml = []
628+
for linkid in linkids:
629+
label = classname + linkid
630+
# if we have a label property, try to use it
631+
# TODO: test for node existence even when
632+
# there's no labelprop!
633+
try:
634+
if labelprop is not None:
635+
label = linkcl.get(linkid, labelprop)
636+
except IndexError:
637+
comments['no_link'] = _('''<strike>The
638+
linked node no longer
639+
exists</strike>''')
640+
subml.append('<strike>%s</strike>'%label)
637641
else:
638-
ml.append(label)
639-
cell.append('%s:\n %s'%(k, ',\n '.join(ml)))
642+
if hrefable:
643+
subml.append('<a href="%s%s">%s</a>'%(
644+
classname, linkid, label))
645+
else:
646+
subml.append(label)
647+
ml.append(sublabel + ', '.join(subml))
648+
cell.append('%s:\n %s'%(k, ', '.join(ml)))
640649
elif isinstance(prop, hyperdb.Link) and args[k]:
641650
label = classname + args[k]
642651
# if we have a label property, try to use it
@@ -809,6 +818,9 @@ def do_remove(client, classname, cl, props, nodeid, filterspec):
809818

810819
#
811820
# $Log: not supported by cvs2svn $
821+
# Revision 1.2 2002/08/15 00:40:10 richard
822+
# cleanup
823+
#
812824
#
813825
#
814826
# vim: set filetype=python ts=4 sw=4 et si

0 commit comments

Comments
 (0)