Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 1113:a95428868bf4
Added the missing keyword/topic interface to classic template (blush)
Cleaned up the classhelp API
Fixed some stuff in the customisation doc example.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 11 Sep 2002 02:49:56 +0000 |
| parents | d759c3cb1f06 |
| children | c26471971d18 |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Wed Sep 11 02:20:35 2002 +0000 +++ b/roundup/cgi/templating.py Wed Sep 11 02:49:56 2002 +0000 @@ -348,17 +348,24 @@ for x in self._klass.filter(None, filterspec, sort, group)] return l - def classhelp(self, properties, label='?', width='400', height='400'): - '''pop up a javascript window with class help + def classhelp(self, properties=None, label='list', width='500', + height='400'): + ''' 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'). + 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 properties is None: + properties = self._klass.getprops(protected=0).keys() + properties.sort() + properties = ','.join(properties) return '<a href="javascript:help_window(\'%s?:template=help&' \ ':contentonly=1&properties=%s\', \'%s\', \'%s\')"><b>'\ '(%s)</b></a>'%(self.classname, properties, width, height, label)
