Skip to content

Commit 5e630d6

Browse files
author
Justus Pendleton
committed
multiline pass through extra keywords args
extra keyword args get turned added to the textarea. this allows users to do multiline(wrap='hard') per http://thread.gmane.org/gmane.comp.bug-tracking.roundup.user/8436
1 parent c9c9a21 commit 5e630d6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

roundup/cgi/templating.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ def field(self, **kwargs):
13791379
kwargs.update({"name": self._formname, "value": value})
13801380
return self.input(**kwargs)
13811381

1382-
def multiline(self, escape=0, rows=5, cols=40):
1382+
def multiline(self, escape=0, rows=5, cols=40, **kwargs):
13831383
""" Render a multiline form edit field for the property.
13841384
13851385
If not editable, just display the plain() value in a <pre> tag.
@@ -1394,7 +1394,9 @@ def multiline(self, escape=0, rows=5, cols=40):
13941394

13951395
value = '&quot;'.join(value.split('"'))
13961396
name = self._formname
1397-
return ('<textarea name="%(name)s" id="%(name)s"'
1397+
passthrough_args = ' '.join(['%s="%s"' % (k, cgi.escape(str(v), True))
1398+
for k,v in kwargs.items()])
1399+
return ('<textarea %(passthrough_args)s name="%(name)s" id="%(name)s"'
13981400
' rows="%(rows)s" cols="%(cols)s">'
13991401
'%(value)s</textarea>') % locals()
14001402

0 commit comments

Comments
 (0)