summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f222817)
raw | patch | inline | side by side (parent: f222817)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 30 Sep 2011 09:35:34 +0000 (09:35 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 30 Sep 2011 09:35:34 +0000 (09:35 +0000) |
of LinkHTMLProperty and MultilinkHTMLProperty -- default is translation
as it used to be
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4650 57a73879-2fb5-44c3-a270-3262357dd7e2
as it used to be
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4650 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/cgi/templating.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index c0825f89c5cbc96956b2d55ae081a49698a65314..5a792dfc6423297bb1876edfcf3a4387f662c355 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- issue2550678: Allow pagesize=-1 which returns all results.
Suggested and implemented by John Kristensen.
Tested by Satchidanand Haridas. (Bernhard)
+- Allow to turn off translation of generated html options in menu method
+ of LinkHTMLProperty and MultilinkHTMLProperty -- default is
+ translation as it used to be (Ralf)
Fixed:
index b0eaf022bc34120b2084c9bc433d5d39b7dd5e1a..3cb9780c909f94bb833018cce663673f09ec2971 100644 (file)
**kwargs)
def menu(self, size=None, height=None, showid=0, additional=[], value=None,
- sort_on=None, html_kwargs = {}, **conditions):
+ sort_on=None, html_kwargs={}, translate=True, **conditions):
""" Render a form select list for this property
"size" is used to limit the length of the list labels
(direction, property) where direction is '+' or '-'. A
single string with the direction prepended may be used.
For example: ('-', 'order'), '+name'.
+ "html_kwargs" specified additional html args for the
+ generated html <select>
+ "translate" indicates if we should do translation of labels
+ using gettext -- this is often desired (e.g. for status
+ labels) but sometimes not.
The remaining keyword arguments are used as conditions for
filtering the items in the list - they're passed as the
lab = lab + ' (%s)'%', '.join(m)
# and generate
- lab = cgi.escape(self._(lab))
+ tr = str
+ if translate:
+ tr = self._
+ lab = cgi.escape(tr(lab))
l.append('<option %svalue="%s">%s</option>'%(s, optionid, lab))
l.append('</select>')
return '\n'.join(l)
return self.input(name=self._formname, size=size, **kwargs)
def menu(self, size=None, height=None, showid=0, additional=[],
- value=None, sort_on=None, html_kwargs = {}, **conditions):
+ value=None, sort_on=None, html_kwargs={}, translate=True,
+ **conditions):
""" Render a form <select> list for this property.
"size" is used to limit the length of the list labels
lab = lab + ' (%s)'%', '.join(m)
# and generate
- lab = cgi.escape(self._(lab))
+ tr = str
+ if translate:
+ tr = self._
+ lab = cgi.escape(tr(lab))
l.append('<option %svalue="%s">%s</option>'%(s, optionid,
lab))
l.append('</select>')