diff roundup/cgi/templating.py @ 2761:10a49678ebf2

allow listing popup to be used in query forms (thanks Marcus Priesch)
author Richard Jones <richard@users.sourceforge.net>
date Fri, 15 Oct 2004 00:48:05 +0000
parents 63f8b13ba85f
children 43e3a7ac1190
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Fri Oct 15 00:25:18 2004 +0000
+++ b/roundup/cgi/templating.py	Fri Oct 15 00:48:05 2004 +0000
@@ -596,21 +596,25 @@
         return l
 
     def classhelp(self, properties=None, label=''"(list)", width='500',
-            height='400', property=''):
-        ''' Pop up a javascript window with class help
+            height='400', property='', form='itemSynopsis'):
+        '''Pop up a javascript window with class help
+
+        This generates a link to a popup window which displays the
+        properties indicated by "properties" of the class named by
+        "classname". The "properties" should be a comma-separated list
+        (eg. 'id,name,description'). Properties defaults to all the
+        properties of a class (excluding id, creator, created and
+        activity).
 
-            This generates a link to a popup window which displays the
-            properties indicated by "properties" of the class named by
-            "classname". The "properties" should be a comma-separated list
-            (eg. 'id,name,description'). Properties defaults to all the
-            properties of a class (excluding id, creator, created and
-            activity).
+        You may optionally override the label displayed, the width and
+        height. The popup window will be resizable and scrollable.
 
-            You may optionally override the label displayed, the width and
-            height. The popup window will be resizable and scrollable.
+        If the "property" arg is given, it's passed through to the
+        javascript help_window function.
 
-            If the "property" arg is given, it's passed through to the
-            javascript help_window function.
+        If the "form" arg is given, it's passed through to the 
+        javascript help_window function. - it's the name of the form
+        the "property" belongs to.
         '''
         if properties is None:
             properties = self._klass.getprops(protected=0).keys()
@@ -618,9 +622,11 @@
             properties = ','.join(properties)
         if property:
             property = '&amp;property=%s'%property
+        if form:
+            form = '&amp;form=%s'%form
         return '<a class="classhelp" href="javascript:help_window(\'%s?'\
-            '@startwith=0&amp;@template=help&amp;properties=%s%s\', \'%s\', \
-            \'%s\')">%s</a>'%(self.classname, properties, property, width,
+           '@startwith=0&amp;@template=help&amp;properties=%s%s%s\', \'%s\', \
+            \'%s\')">%s</a>'%(self.classname, properties, property, form, width,
             height, self._(label))
 
     def submit(self, label=''"Submit New Entry"):

Roundup Issue Tracker: http://roundup-tracker.org/