added link to show/hide non-required fields
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 22 Feb 2009 01:57:52 +0000 (01:57 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 22 Feb 2009 01:57:52 +0000 (01:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12259 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/actor/user/register.js
Open-ILS/web/templates/default/actor/user/register.tt2

index 7e4842d..4ca295a 100644 (file)
@@ -174,8 +174,8 @@ function fleshFMRow(row, fmcls, args) {
         dijitArgs : {style: wstyle},
         orgLimitPerms : ['UPDATE_USER'],
     });
-    widget.build();
 
+    widget.build();
     widget._wtype = fmcls;
     widget._fmfield = fmfield;
     widget._addr = args.addr;
@@ -372,5 +372,13 @@ function uEditDeleteAddr(id) {
     widgetPile = widgetPile.filter(function(w){return (w._addr != id)});
 }
 
+function uEditToggleRequired() {
+    if((tbody.className +'').match(/hide-non-required/))
+        openils.Util.removeCSSClass(tbody, 'hide-non-required');
+    else
+        openils.Util.addCSSClass(tbody, 'hide-non-required');
+}
+
+
 
 openils.Util.addOnLoad(load);
index e0455d1..5c1d000 100644 (file)
 
     .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
 
+    .hide-non-required tr:not([required]) {
+        visibility:hidden;
+        display:none;
+    }
+
+    #require-toggle {
+        margin-top:10px;
+        margin-bottom:-5px;
+    }
+
 </style>
 
 <table>
     <tbody id='uedit-tbody'>
-        <tr fmclass='ac' fmfield='barcode'/>
-        <tr fmclass='au' fmfield='usrname'/>
-        <tr fmclass='au' fmfield='passwd'/>
-        <tr fmclass='au' fmfield='passwd'><td/><td>Verify Password</td><td/></tr>
-        <tr fmclass='au' fmfield='first_given_name'/>
+        <tr fmclass='ac' fmfield='barcode' required='required'/>
+        <tr fmclass='au' fmfield='usrname' required='required'/>
+        <tr fmclass='au' fmfield='passwd' required='required'/>
+        <tr fmclass='au' fmfield='passwd' required='required'><td/><td>Verify Password</td><td/></tr>
+        <tr fmclass='au' fmfield='first_given_name' required='required'/>
         <tr fmclass='au' fmfield='second_given_name'/>
-        <tr fmclass='au' fmfield='family_name'/>
+        <tr fmclass='au' fmfield='family_name' required='required'/>
         <tr fmclass='au' fmfield='suffix'/>
         <tr fmclass='au' fmfield='alias'/>
         <tr fmclass='au' fmfield='dob'/>
         <tr fmclass='au' fmfield='juvenile'/>
-        <tr fmclass='au' fmfield='ident_type'/>
-        <tr fmclass='au' fmfield='ident_value'/>
+        <tr fmclass='au' fmfield='ident_type' required='required'/>
+        <tr fmclass='au' fmfield='ident_value' required='required'/>
         <tr fmclass='au' fmfield='email'/>
         <tr fmclass='au' fmfield='day_phone'/>
         <tr fmclass='au' fmfield='evening_phone'/>
         <tr fmclass='au' fmfield='other_phone'/>
-        <tr fmclass='au' fmfield='home_ou'/>
-        <tr fmclass='au' fmfield='profile'/>
-        <tr fmclass='au' fmfield='expire_date'/>
-        <tr fmclass='au' fmfield='net_access_level'/>
+        <tr fmclass='au' fmfield='home_ou' required='required'/>
+        <tr fmclass='au' fmfield='profile' required='required'/>
+        <tr fmclass='au' fmfield='expire_date' required='required'/>
+        <tr fmclass='au' fmfield='net_access_level' required='required'/>
         <tr fmclass='au' fmfield='active'/>
         <tr fmclass='au' fmfield='barred'/>
         <tr fmclass='au' fmfield='master_account'/>
         <tr fmclass='au' fmfield='alert_message' wclass='dijit.form.Textarea' wstyle='height:5em'/>
 
         <!-- Address -->
-        <tr name='uedit-addr-divider' class='divider' type='addr-template'>
+        <tr name='uedit-addr-divider' class='divider' type='addr-template' required='show'>
             <td colspan='2'>Address</td>
             <td>
                 <span>Mailing</span><input type='radio' name='mailing_address'>
                 <button name='delete-button' class='uedit-addr-del-button'>X</button>
             </td>
         </tr>
-        <tr fmclass='aua' fmfield='address_type' type='addr-template'/>
-        <tr fmclass='aua' fmfield='post_code' type='addr-template'/>
-        <tr fmclass='aua' fmfield='street1' type='addr-template'/>
-        <tr fmclass='aua' fmfield='street2' type='addr-template'/>
-        <tr fmclass='aua' fmfield='city' type='addr-template'/>
-        <tr fmclass='aua' fmfield='county' type='addr-template'/>
-        <tr fmclass='aua' fmfield='state' type='addr-template'/>
-        <tr fmclass='aua' fmfield='country' type='addr-template'/>
-        <tr fmclass='aua' fmfield='valid' type='addr-template'/>
-        <tr fmclass='aua' fmfield='within_city_limits' type='addr-template'/>
+        <tr fmclass='aua' fmfield='address_type' type='addr-template' required='show'/>
+        <tr fmclass='aua' fmfield='post_code' type='addr-template' required='required'/>
+        <tr fmclass='aua' fmfield='street1' type='addr-template' required='required'/>
+        <tr fmclass='aua' fmfield='street2' type='addr-template' required='show'/>
+        <tr fmclass='aua' fmfield='city' type='addr-template' required='required'/>
+        <tr fmclass='aua' fmfield='county' type='addr-template' required='show'/>
+        <tr fmclass='aua' fmfield='state' type='addr-template' required='required'/>
+        <tr fmclass='aua' fmfield='country' type='addr-template' required='required'/>
+        <tr fmclass='aua' fmfield='valid' type='addr-template' required='show'/>
+        <tr fmclass='aua' fmfield='within_city_limits' type='addr-template' required='show'/>
 
         <tr id='new-addr-row' class='newaddr-row'>
             <td colspan='0' style='text-align:center;'>
 <div id='uedit-save-div'>
     <button dojoType='dijit.form.Button' jsId='saveButton' onClick='uEditSave'>Save</button>
     <button dojoType='dijit.form.Button' jsId='saveCloneButton' onClick='uEditSaveClone'>Save &amp; Clone</button>
+    <div id='require-toggle'>
+        <a href='javascript:uEditToggleRequired();'>Show/Hide Required Fields</a>
+    </div>
 </div>
 
 <!-- context help widget -->