Skip to content

Commit ca8702c

Browse files
committed
issue2550807 enhance classhelp method with ability to set html properties
on the generated link.
1 parent 9e903f4 commit ca8702c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

roundup/cgi/templating.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,8 @@ def filter(self, request=None, filterspec={}, sort=[], group=[]):
640640

641641
def classhelp(self, properties=None, label=''"(list)", width='500',
642642
height='400', property='', form='itemSynopsis',
643-
pagesize=50, inputtype="checkbox", sort=None, filter=None):
643+
pagesize=50, inputtype="checkbox", html_kwargs={},
644+
sort=None, filter=None):
644645
"""Pop up a javascript window with class help
645646
646647
This generates a link to a popup window which displays the
@@ -704,8 +705,9 @@ def classhelp(self, properties=None, label=''"(list)", width='500',
704705
sort, pagesize, filter)
705706
onclick = "javascript:help_window('%s', '%s', '%s');return false;" % \
706707
(help_url, width, height)
707-
return '<a class="classhelp" href="%s" onclick="%s">%s</a>' % \
708-
(help_url, onclick, self._(label))
708+
return '<a class="classhelp" href="%s" onclick="%s" %s>%s</a>' % \
709+
(help_url, onclick, cgi_escape_attrs(**html_kwargs),
710+
self._(label))
709711

710712
def submit(self, label=''"Submit New Entry", action="new"):
711713
""" Generate a submit button (and action hidden element)

0 commit comments

Comments
 (0)