changeset 229:c956811fba9a

flatland filters: fix copy&paste bug, only use "required" attr in input fields
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 14 May 2011 23:06:29 +0200
parents 3d9209455929
children 29b3586181cb
files MoinMoin/util/forms.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/forms.py	Sat May 14 19:16:36 2011 +0200
+++ b/MoinMoin/util/forms.py	Sat May 14 23:06:29 2011 +0200
@@ -37,7 +37,8 @@
 def required_filter(tagname, attributes, contents, context, bind):
     if (bind is not None and not bind.optional):
         attributes[u'class'] = u'required'
-        attributes[u'required'] = u'required'
+        if tagname == 'input':
+            attributes[u'required'] = u'required'
     return contents
 required_filter.tags = set(['input', 'label'])
 
@@ -47,7 +48,7 @@
         if autofocus:
             attributes[u'autofocus'] = u'autofocus'
     return contents
-required_filter.tags = set(['input', 'textarea', ])
+autofocus_filter.tags = set(['input', 'textarea', ])
 
 def placeholder_filter(tagname, attributes, contents, context, bind):
     if bind is not None:
@@ -55,7 +56,7 @@
         if placeholder:
             attributes[u'placeholder'] = placeholder
     return contents
-required_filter.tags = set(['input', 'textarea', ])
+placeholder_filter.tags = set(['input', 'textarea', ])
 
 def error_filter_factory(class_='moin-error'):
     """Returns an HTML generation filter annotating field CSS class on error.