extension to input-presentation [patch included]

Greg Pfeil avatarGreg Pfeil created an issue

Here's a small change to input-presentation. I added a new initarg :obscuredp, which causes the input type to be “password” instead of “text”.

diff -r 37bd0ab5f550 src/views/formview/formview.lisp
--- a/src/views/formview/formview.lisp	Sun Feb 27 21:40:10 2011 +0100
+++ b/src/views/formview/formview.lisp	Sun Feb 27 22:10:19 2011 -0500
@@ -206,7 +206,11 @@
 	       :documentation "Maximum length of an input.")
    (size :accessor input-presentation-size
          :initarg :size
-         :initform nil))
+         :initform nil)
+   (obscuredp :accessor input-presentation-obscuredp
+              :initarg :obscuredp
+              :initform nil
+              :documentation "If T, uses bullets instead of clear text."))
   (:documentation "A default presentation for forms renders an input
   field."))
 
@@ -375,7 +379,9 @@
     (multiple-value-bind (intermediate-value intermediate-value-p)
 	(form-field-intermediate-value field intermediate-values)
       (with-html
-	  (:input :type "text" :name attributized-slot-name
+	  (:input :type (if (input-presentation-obscuredp presentation)
+                            "password" "text")
+                 :name attributized-slot-name
 		  :value (if intermediate-value-p
 			     intermediate-value
 			     (apply #'print-view-field-value value presentation field view widget obj args))

Comments (1)

  1. Anonymous

    The old view stuff (of which input-presentation is a part) does have a password presentation already, though...

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.