massive refactoring in preparation of release.
[clinton/lisp-on-lines.git] / src / slot-presentations / date.lisp
index 161b31c..973f8fe 100644 (file)
@@ -1,5 +1,20 @@
 (in-package :lol)
 
+(defclass form-element (widget-component)
+  ((client-value :accessor client-value :initform ""
+                :initarg :client-value
+                 :documentation "Whetever the client's browse sent for this form element."
+                 :backtrack t)
+   (lisp-value :accessor lisp-value :initform +uninitialized+
+               :initarg :lisp-value
+               :documentation "The current lisp object in this form element."
+               :backtrack t))
+  (:metaclass standard-component-class)
+  (:documentation "A single value in a form.
+
+A form-element is, simply put, a wrapper for a value in an html
+form."))
+
 ;;;; Expiry date picker
 
 (defslot-presentation date-slot-presentation (clsql-wall-time-slot-presentation)
@@ -76,7 +91,7 @@
 (defclass %date-field (date-field)
   ((day :component (%integer-range-field :min-value 1 :max-value 31))
    (month :component (%integer-range-field :min-value 1 :max-value 12))
-   (year :component (%integer-range-field :min-value 2005 :max-value 2015) ))
+   (year :component (%integer-range-field :min-value 2006 :max-value 2015) ))
   (:metaclass standard-component-class))
 
 (defmethod shared-initialize :after ((field %date-field) slot-names
@@ -105,20 +120,7 @@ This obviously implies that you can't have a form element whose
 real value is +uninitialized+, since +uninitialized+ is a ucw
 internal symbol this shouldn't be a problem.")
 
-(defclass form-element (widget-component)
-  ((client-value :accessor client-value :initform ""
-                :initarg :client-value
-                 :documentation "Whetever the client's browse sent for this form element."
-                 :backtrack t)
-   (lisp-value :accessor lisp-value :initform +uninitialized+
-               :initarg :lisp-value
-               :documentation "The current lisp object in this form element."
-               :backtrack t))
-  (:metaclass standard-component-class)
-  (:documentation "A single value in a form.
 
-A form-element is, simply put, a wrapper for a value in an html
-form."))
 
 (defgeneric read-client-value (element)
   (:method ((element form-element))
@@ -241,4 +243,4 @@ form."))
     (iterate
       (for value from (min-value range) to (max-value range))
       (<:option :value value :selected (= value (lisp-value range))
-                (<:as-html value)))))
\ No newline at end of file
+                (<:as-html value)))))