index 59ce26cc19cf92fd964d59f47e7e4eaa2aa6e7de..2f6557a1fdb0abba2b3e4d660048c9cfdc2e923b 100644 (file)
--- a/roundup/htmltemplate.py
+++ b/roundup/htmltemplate.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: htmltemplate.py,v 1.85 2002-04-02 01:40:58 richard Exp $
+# $Id: htmltemplate.py,v 1.89 2002-05-15 06:34:47 richard Exp $
__doc__ = """
Template engine.
elif isinstance(propclass, hyperdb.Multilink):
sortfunc = self.make_sort_function(propclass.classname)
linkcl = self.db.classes[propclass.classname]
- list = linkcl.list()
- list.sort(sortfunc)
- l = []
+ if value:
+ value.sort(sortfunc)
# map the id to the label property
if not showid:
k = linkcl.labelprop()
linkname = propclass.classname
linkcl = self.db.classes[linkname]
k = linkcl.labelprop()
- linkvalue = cgi.escape(linkcl.get(value, k))
+ linkvalue = cgi.escape(str(linkcl.get(value, k)))
if showid:
label = value
- title = ' title="%s"'%linkvalue
- # note ... this should be urllib.quote(linkcl.get(value, k))
+ title = ' title="%s"'%linkvalue
+ # note ... this should be urllib.quote(linkcl.get(value, k))
else:
label = linkvalue
+ title = ''
if is_download:
return '<a href="%s%s/%s"%s>%s</a>'%(linkname, value,
linkvalue, title, label)
k = linkcl.labelprop()
l = []
for value in value:
- linkvalue = cgi.escape(linkcl.get(value, k))
+ linkvalue = cgi.escape(str(linkcl.get(value, k)))
if showid:
label = value
title = ' title="%s"'%linkvalue
- # note ... this should be urllib.quote(linkcl.get(value, k))
+ # note ... this should be urllib.quote(linkcl.get(value, k))
else:
label = linkvalue
+ title = ''
if is_download:
l.append('<a href="%s%s/%s"%s>%s</a>'%(linkname, value,
linkvalue, title, label))
if pretty:
if not self.nodeid:
return _('now')
- pretty = interval.pretty()
- if pretty is None:
- pretty = value.pretty()
- return pretty
+ return interval.pretty()
return str(interval)
def do_download(self, property, **args):
l = []
k = linkcl.labelprop()
for optionid in linkcl.list():
- option = cgi.escape(linkcl.get(optionid, k))
+ option = cgi.escape(str(linkcl.get(optionid, k)))
if optionid in value or option in value:
checked = 'checked'
else:
#
# $Log: not supported by cvs2svn $
+# Revision 1.88 2002/04/24 08:34:35 rochecompaan
+# Sorting was applied to all nodes of the MultiLink class instead of
+# the nodes that are actually linked to in the "field" template
+# function. This adds about 20+ seconds in the display of an issue if
+# your database has a 1000 or more issue in it.
+#
+# Revision 1.87 2002/04/03 06:12:46 richard
+# Fix for date properties as labels.
+#
+# Revision 1.86 2002/04/03 05:54:31 richard
+# Fixed serialisation problem by moving the serialisation step out of the
+# hyperdb.Class (get, set) into the hyperdb.Database.
+#
+# Also fixed htmltemplate after the showid changes I made yesterday.
+#
+# Unit tests for all of the above written.
+#
+# Revision 1.85 2002/04/02 01:40:58 richard
+# . link() htmltemplate function now has a "showid" option for links and
+# multilinks. When true, it only displays the linked node id as the anchor
+# text. The link value is displayed as a tooltip using the title anchor
+# attribute.
+#
# Revision 1.84 2002/03/29 19:41:48 rochecompaan
# . Fixed display of mutlilink properties when using the template
# functions, menu and plain.