Commits

Anonymous committed 6a82330

Add renderer for passwords.

Comments (0)

Files changed (2)

formbar/renderer.py

             return DropdownFieldRenderer(field, translate)
         elif renderer.render_type == "datepicker":
             return DateFieldRenderer(field, translate)
+        elif renderer.render_type == "password":
+            return PasswordFieldRenderer(field, translate)
     else:
         # Try to determine the datatype of the field and set approriate
         # renderer.
 
     def __init__(self, field, translate):
         FieldRenderer.__init__(self, field, translate)
-        self.template = template_lookup.get_template("fa_field.mako")
+        self.template = template_lookup.get_template("password.mako")
 
 
 class DropdownFieldRenderer(FieldRenderer):

formbar/templates/password.mako

+% if field.is_readonly():
+  <div class="readonlyfield">
+    ${field.get_value("") or "&nbsp;"}
+  </div>
+% else:
+  <input type="password" name="${field.name}" value="${field.get_value()}"/>
+% endif