Hi, 

attached therewith, you'll find a patch that will add the
`required-slot' class for radio buttons and checkboxes. Pretty much the
same code from the implementation of other field types.

Thanks,
Andrea.

-- 
"We act as though comfort and luxury were the chief requirements
of life, when all that we need to make us happy is something to be
 enthusiastic about." - Einstein


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

# HG changeset patch
# User Andrea Russo <[email protected]>
# Date 1244998540 -7200
# Node ID 727d479d6192a5ce252b204d3913a3888924782b
# Parent  ce19ea797a36af02ac20c1d11f364eb9d4f109f8
* checkboxes.lisp, radio.lisp (render-view-field): Add the `required-slot' CSS class when the field is required.

diff -r ce19ea797a36 -r 727d479d6192 src/views/types/presentations/checkboxes.lisp
--- a/src/views/types/presentations/checkboxes.lisp	Sun Jun 14 18:46:07 2009 +0200
+++ b/src/views/types/presentations/checkboxes.lisp	Sun Jun 14 18:55:40 2009 +0200
@@ -25,7 +25,9 @@
            (:span :class "label"
                   (:span :class "slot-name"
                          (:span :class "extra"
-                                (str (view-field-label field)) ":&nbsp;")))
+                                (str (view-field-label field)) ":&nbsp;"
+                                (when (form-view-field-required-p field)
+                                  (htm (:em :class "required-slot" "(required)&nbsp;"))))))
            (apply #'render-view-field-value
                   value presentation
                   field view widget obj
diff -r ce19ea797a36 -r 727d479d6192 src/views/types/presentations/radio.lisp
--- a/src/views/types/presentations/radio.lisp	Sun Jun 14 18:46:07 2009 +0200
+++ b/src/views/types/presentations/radio.lisp	Sun Jun 14 18:55:40 2009 +0200
@@ -23,7 +23,9 @@
 	   (:span :class "label"
 		  (:span :class "slot-name"
 			 (:span :class "extra"
-				(str (view-field-label field)) ":&nbsp;")))
+				(str (view-field-label field)) ":&nbsp;"
+                                (when (form-view-field-required-p field)
+                                  (htm (:em :class "required-slot" "(required)&nbsp;"))))))
 	   (apply #'render-view-field-value
 		  value presentation
 		  field view widget obj

Reply via email to