Author: jmorliaguet
Date: Thu Feb  9 14:01:28 2006
New Revision: 2331

Modified:
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/browser.py
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/cpsskins_form_validation.pt
Log:

- added support for zope schemas' description field property



Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/browser.py
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/browser.py
     (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/browser.py
     Thu Feb  9 14:01:28 2006
@@ -15,13 +15,28 @@
 
 class DummySchema(Interface):
 
-    firstname = Text(title=u'First name', required=True)
-    lastname = Text(title=u'Last name', required=True)
-    email = Text(title=u'Email address', required=False,
-                 default=u'[EMAIL PROTECTED]', constraint = re.compile(
+    firstname = Text(
+        title=u'First name',
+        description=u'Your name',
+        required=True,
+        )
+
+    lastname = Text(
+        title=u'Last name',
+        description=u'Your surname',
+        required=True,
+        )
+
+    email = Text(
+        title=u'Email address',
+        description=u'Your email address',
+        default=u'[EMAIL PROTECTED]',
+        constraint = re.compile(
                    "^([0-9a-z_&.+-]+!)*[0-9a-z_&.+-]+"
                    "@(([0-9a-z]([0-9a-z-]*[0-9a-z])?\.)+"
-                   "[a-z]{2,3}|([0-9]{1,3}\.){3}[0-9]{1,3})$").match)
+                   "[a-z]{2,3}|([0-9]{1,3}\.){3}[0-9]{1,3})$").match,
+        required=False,
+        )
 
 form_layout = ['firstname', 'lastname', 'email']
 
@@ -43,6 +58,7 @@
             fields.append({
                 'name': name,
                 'label': field_def.title,
+                'hint': field_def.description,
                 'value': field_def.default,
                 'status': u'',
             })

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/cpsskins_form_validation.pt
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/cpsskins_form_validation.pt
    (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/forms/cpsskins_form_validation.pt
    Thu Feb  9 14:01:28 2006
@@ -20,16 +20,19 @@
     background-color: #f6f3f0;
     padding: 1em;
     font: 1.3em arial, sans-serif;
-    width: 500px;
   }
 
   label {
     padding: 1em;
   }
 
+  .hint {
+    padding: 1em;
+  }
+
   .status {
-    color: red;
     padding: 1em;
+    color: red;
   }
 
   input {
@@ -94,6 +97,11 @@
           tag: "label",
           text: field.label
         });
+        var hint = Canvas.createNode({
+          tag: "span",
+          classes: "hint",
+          text: '(' + field.hint + ')'
+        });
         var status = Canvas.createNode({
           tag: "span",
           classes: "status",
@@ -109,6 +117,7 @@
         });
         p.appendChild(label);
         p.appendChild(input);
+        p.appendChild(hint);
         p.appendChild(status);
         return p;
       }
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to