From: rochecompaan Date: Fri, 29 Mar 2002 19:41:48 +0000 (+0000) Subject: . Fixed display of mutlilink properties when using the template X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0069a0a581c8622900ded116c1df110167b1c64f;p=roundup.git . Fixed display of mutlilink properties when using the template functions, menu and plain. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@685 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index 5143ab7..1460cbb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -28,6 +28,8 @@ Feature: . #517734 ] web header customisation is obscure . All messages sent to the nosy list are now encoded as quoted-printable before they are sent. + . Fixed display of mutlilink properties when using the template + functions, menu and plain. Fixed: . Clean up mail handling, multipart handling. diff --git a/roundup/htmltemplate.py b/roundup/htmltemplate.py index 55f7fee..d85684f 100644 --- a/roundup/htmltemplate.py +++ b/roundup/htmltemplate.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: htmltemplate.py,v 1.83 2002-02-27 04:14:31 richard Exp $ +# $Id: htmltemplate.py,v 1.84 2002-03-29 19:41:48 rochecompaan Exp $ __doc__ = """ Template engine. @@ -110,7 +110,10 @@ class TemplateFunctions: elif isinstance(propclass, hyperdb.Multilink): linkcl = self.db.classes[propclass.classname] k = linkcl.labelprop() - value = ', '.join(value) + labels = [] + for v in value: + labels.append(linkcl.get(v, k)) + value = ', '.join(labels) else: value = _('Plain: bad propclass "%(propclass)s"')%locals() if escape: @@ -284,7 +287,7 @@ class TemplateFunctions: for optionid in options: option = linkcl.get(optionid, k) s = '' - if optionid in value: + if optionid in value or option in value: s = 'selected ' if showid: lab = '%s%s: %s'%(propclass.classname, optionid, option) @@ -313,7 +316,7 @@ class TemplateFunctions: for optionid in options: option = linkcl.get(optionid, k) s = '' - if optionid == value: + if value in [optionid, option]: s = 'selected ' if showid: lab = '%s%s: %s'%(propclass.classname, optionid, option) @@ -1111,6 +1114,9 @@ class NewItemTemplate(TemplateFunctions): # # $Log: not supported by cvs2svn $ +# Revision 1.83 2002/02/27 04:14:31 richard +# Ran it through pychecker, made fixes +# # Revision 1.82 2002/02/21 23:11:45 richard # . fixed some problems in date calculations (calendar.py doesn't handle over- # and under-flow). Also, hour/minute/second intervals may now be more than diff --git a/test/test_htmltemplate.py b/test/test_htmltemplate.py index bf016ff..3fd109c 100644 --- a/test/test_htmltemplate.py +++ b/test/test_htmltemplate.py @@ -8,7 +8,7 @@ # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# $Id: test_htmltemplate.py,v 1.11 2002-02-21 23:11:45 richard Exp $ +# $Id: test_htmltemplate.py,v 1.12 2002-03-29 19:41:48 rochecompaan Exp $ import unittest, cgi, time @@ -97,7 +97,7 @@ class NodeCase(unittest.TestCase): self.assertEqual(self.tf.do_plain('link'), 'the key1') def testPlain_multilink(self): - self.assertEqual(self.tf.do_plain('multilink'), '1, 2') + self.assertEqual(self.tf.do_plain('multilink'), 'the key1, the key2') # def do_field(self, property, size=None, showid=0): @@ -344,6 +344,11 @@ def suite(): # # $Log: not supported by cvs2svn $ +# Revision 1.11 2002/02/21 23:11:45 richard +# . fixed some problems in date calculations (calendar.py doesn't handle over- +# and under-flow). Also, hour/minute/second intervals may now be more than +# 99 each. +# # Revision 1.10 2002/02/21 06:57:39 richard # . Added popup help for classes using the classhelp html template function. # - add