Skip to content

Commit f20dd7f

Browse files
author
Richard Jones
committed
plain rendering of links in the htmltemplate now generate a hyperlink...
...to the linked node's page. this allows a display very similar to bugzilla's where you can actually find out information about the linked node.
1 parent dfb4f90 commit f20dd7f

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Fixed:
2020
. #502951 ] adding new properties to old database
2121
. #502953 ] nosy-like treatment of other multilinks
2222
. #503164 ] create and passwords
23+
. plain rendering of links in the htmltemplate now generate a hyperlink to
24+
the linked node's page.
2325

2426

2527
2002-01-08 - 0.4.0b1

roundup/htmltemplate.py

Lines changed: 13 additions & 4 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: htmltemplate.py,v 1.55 2002-01-14 06:45:03 richard Exp $
18+
# $Id: htmltemplate.py,v 1.56 2002-01-14 07:04:36 richard Exp $
1919

2020
__doc__ = """
2121
Template engine.
@@ -85,12 +85,16 @@ def do_plain(self, property, escape=0):
8585
elif isinstance(propclass, hyperdb.Link):
8686
linkcl = self.db.classes[propclass.classname]
8787
k = linkcl.labelprop()
88-
if value: value = str(linkcl.get(value, k))
89-
else: value = _('[unselected]')
88+
if value:
89+
value = '<a href="%s%s">%s</a>'%(propclass.classname, value,
90+
linkcl.get(value, k))
91+
else:
92+
value = _('[unselected]')
9093
elif isinstance(propclass, hyperdb.Multilink):
9194
linkcl = self.db.classes[propclass.classname]
9295
k = linkcl.labelprop()
93-
value = ', '.join([linkcl.get(i, k) for i in value])
96+
value = ', '.join(['<a href="%s%s">%s</a>'%(propclass.classname,
97+
i, linkcl.get(i, k)) for i in value])
9498
else:
9599
s = _('Plain: bad propclass "%(propclass)s"')%locals()
96100
if escape:
@@ -882,6 +886,11 @@ def render(self, form):
882886

883887
#
884888
# $Log: not supported by cvs2svn $
889+
# Revision 1.55 2002/01/14 06:45:03 richard
890+
# . #502953 ] nosy-like treatment of other multilinks
891+
# ... had to revert most of the previous change to the multilink field
892+
# display... not good.
893+
#
885894
# Revision 1.54 2002/01/14 05:16:51 richard
886895
# The submit buttons need a name attribute or mozilla won't submit without a
887896
# file upload. Yeah, that's bloody obscure. Grr.

0 commit comments

Comments
 (0)