web/form.py
branchtls-sprint
changeset 908 136d91725ecf
parent 907 192800415f59
child 911 467fb77c6a33
equal deleted inserted replaced
907:192800415f59 908:136d91725ecf
   290 class TextInput(Input):
   290 class TextInput(Input):
   291     type = 'text'
   291     type = 'text'
   292 
   292 
   293 class PasswordInput(Input):
   293 class PasswordInput(Input):
   294     type = 'password'
   294     type = 'password'
   295     # XXX password validation
   295     
       
   296     def render(self, form, field):
       
   297         self.add_media(form)
       
   298         name, values, attrs = self._render_attrs(form, field)
       
   299         inputs = [tags.input(name=name, value=value, type=self.type, **attrs),
       
   300                   '<br/>',
       
   301                   tags.input(name=name+'-confirm', type=self.type, **attrs),
       
   302                   '&nbsp;', tags.span(form.req._('confirm password'),
       
   303                                       **{'class': 'emphasis'})]
       
   304         return u'\n'.join(inputs)
   296 
   305 
   297 class FileInput(Input):
   306 class FileInput(Input):
   298     type = 'file'
   307     type = 'file'
   299     
   308     
   300     def _render_attrs(self, form, field):
   309     def _render_attrs(self, form, field):