From: richard Date: Tue, 11 Jun 2002 04:57:04 +0000 (+0000) Subject: Added optional additional property to display in a Multilink form menu. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cc8e8d80aed213072735c374c8198a4a70bee3d5;p=roundup.git Added optional additional property to display in a Multilink form menu. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@770 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/htmltemplate.py b/roundup/htmltemplate.py index e92fdd3..6a2ece4 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.91 2002-05-31 00:08:02 richard Exp $ +# $Id: htmltemplate.py,v 1.92 2002-06-11 04:57:04 richard Exp $ __doc__ = """ Template engine. @@ -262,8 +262,13 @@ class TemplateFunctions: return ''%( property, rows, cols, value) - def do_menu(self, property, size=None, height=None, showid=0): - ''' for a Link property, display a menu of the available choices + def do_menu(self, property, size=None, height=None, showid=0, + additional=[]): + ''' For a Link/Multilink property, display a menu of the available + choices + + If the additional properties are specified, they will be + included in the text of each option in (brackets, with, commas). ''' if not self.nodeid and self.form is None and self.filterspec is None: return _('[Field: not called from item]') @@ -300,6 +305,11 @@ class TemplateFunctions: lab = option if size is not None and len(lab) > size: lab = lab[:size-3] + '...' + if additional: + m = [] + for propname in additional: + m.append(linkcl.get(optionid, propname)) + lab = lab + ' (%s)'%', '.join(m) lab = cgi.escape(lab) l.append(''%(s, optionid, lab)) @@ -329,6 +339,11 @@ class TemplateFunctions: lab = option if size is not None and len(lab) > size: lab = lab[:size-3] + '...' + if additional: + m = [] + for propname in additional: + m.append(linkcl.get(optionid, propname)) + lab = lab + ' (%s)'%', '.join(m) lab = cgi.escape(lab) l.append(''%(s, optionid, lab)) l.append('') @@ -1176,6 +1191,9 @@ class NewItemTemplate(TemplateFunctions): # # $Log: not supported by cvs2svn $ +# Revision 1.91 2002/05/31 00:08:02 richard +# can now just display a link/multilink id - useful for stylesheet stuff +# # Revision 1.90 2002/05/25 07:16:24 rochecompaan # Merged search_indexing-branch with HEAD #