[zopeorg-checkins] CVS: Products/ZopeOrg-NV/skins/nzo - join_form.pt:1.1 personalize.py:1.3 personalize_form.pt:1.1 main_template.pt:1.5 register.py:1.2

Jens Vagelpohl jens at zope.com
Fri Aug 8 10:35:15 EDT 2003


Update of /cvs-zopeorg/Products/ZopeOrg-NV/skins/nzo
In directory cvs.zope.org:/tmp/cvs-serv417

Modified Files:
	main_template.pt register.py 
Added Files:
	join_form.pt personalize.py personalize_form.pt 
Log Message:
- put some of the membership skins stuff into nzo skins folder
- make it work again



=== Added File Products/ZopeOrg-NV/skins/nzo/join_form.pt ===
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
      lang="en-US"
      metal:use-macro="here/main_template/macros/master"
      i18n:domain="plone">

<body>

<div metal:fill-slot="main"
     tal:define="errors python:request.get('errors', {})">
 
    <h1 i18n:translate="heading_registration_form">Please register</h1>

    <p i18n:translate="description_registration_form">
    By registering with us, you will have your own account with the
    possibility to have personalized content, and you will be able to add
    your own documents, images and files to the site.
    </p> 

    <form class="group"
          action="register" 
          method="post"
          tal:define="allowEnterPassword here/portal_properties/site_properties/validate_email|nothing;"
          tal:attributes="action python:here.portal_form_url(template.id)" >

        <span class="legend" i18n:translate="legend_personal_details">Personal Details</span>

        <input type="hidden" name="came_from" value=""
               tal:attributes="value request/came_from|request/HTTP_REFERER" />
        <input type="hidden" name="last_visit:date" value="ZopeTime"
               tal:attributes="value here/ZopeTime" />
        <input type="hidden" name="prev_visit:date" value="ZopeTime"
               tal:attributes="value here/ZopeTime" />

        <div class="row"
             tal:replace="nothing"
             tal:define="error_fullname errors/fullname| nothing;
                         fullname request/fullname | nothing;" >
            
            <div class="label">
                <span i18n:translate="label_full_name">Full Name</span>
                <div id="full_name_help" 
                     i18n:translate="help_full_name_creation"
                     class="help" 
                     style="visibility:hidden">
                Enter your full name, eg. John Smith.
                </div>
            </div>
            
            <div class="field"
                  tal:attributes="class python:test(error_fullname, 'field error', 'field')" >

                <div tal:condition="error_fullname">
                    <tal:block i18n:translate="" content="error_fullname">Error</tal:block>
                    <br />
                </div>

                <input type="text" 
                       name="fullname" 
                       size="30"
                       value="fullname"
                       tabindex=""
                       onfocus="formtooltip('full_name_help',1)" 
                       onblur="formtooltip('full_name_help',0)" 
                       tal:attributes="value fullname;
                                       tabindex tabindex/next;"
                       />
            </div>

        </div>
               
        <div class="row"
             tal:define="error_username errors/username| nothing;
                         username request/username | nothing;" >
            
            <div class="label required">
                <span i18n:translate="label_user_name">User Name</span>
                <div id="user_name_help" 
                     i18n:translate="help_user_name_creation"
                     class="help" 
                     style="visibility:hidden">
                Enter the user name you want, usually something like
                'jsmith'. No spaces or special characters. 
                This is the name you use to log in.
                </div>
            </div>
            
            <div class="field"
                  tal:attributes="class python:test(error_username, 'field error', 'field')" >

                <div tal:condition="error_username">
                    <tal:block i18n:translate="" content="error_username">Error</tal:block>
                    <br />
                </div>

                <input type="text" 
                       name="username" 
                       size="30"
                       value="username"
                       tabindex=""
                       onfocus="formtooltip('user_name_help',1)" 
                       onblur="formtooltip('user_name_help',0)" 
                       tal:attributes="value username;
                                       tabindex tabindex/next;"
                       />
            </div>

        </div>

        <div class="row"
             tal:define="error_email errors/email | nothing;
                         email request/email | nothing;" >

            <div class="label required">
                <span i18n:translate="label_email">E-mail</span>
                <div id="email_help" 
                     i18n:translate="help_email_creation"
                     class="help" 
                     style="visibility:hidden">
                Enter your email address. This is necessary in case you lose your
                password. We respect your privacy, and will not give the address
                away to any third parties.
                </div>            
            </div>

            <div class="field"
                  tal:attributes="class python:test(error_email, 'field error', 'field')" >
		  
                <div tal:condition="error_email">
                    <tal:block i18n:translate="" content="error_email">Error</tal:block>
                    <br />
                </div>

                <input type="text" 
                       name="email" 
                       size="30"
                       tabindex=""
                       onfocus="formtooltip('email_help',1)" 
                       onblur="formtooltip('email_help',0)" 
                       tal:attributes="value email;
                                       tabindex tabindex/next;"
                       />
            </div>
        </div>


        <div class="row" 
             tal:condition="not: allowEnterPassword"
             tal:define="error_password errors/password | nothing;
                         password request/password | nothing;" >

            <div class="label required">
                <span i18n:translate="label_password">Password</span>
                <div id="password_help" 
                     i18n:translate="help_password_creation"
                     class="help" 
                     style="visibility:hidden">
                Enter the password you want. Minimum 5 characters.
                </div>
            </div>

            <div class="field"
                  tal:attributes="class python:test(error_password, 'field error', 'field')" >
		  
                <div tal:condition="error_password">
                    <tal:block i18n:translate="" content="error_password">Error</tal:block>
                    <br />
                </div>
	       
                <input type="password" 
                       name="password" 
                       size="10"
                       value="" 
                       tabindex=""
                       onfocus="formtooltip('password_help',1)" 
                       onblur="formtooltip('password_help',0)" 
                       tal:attributes="value password;
                                       tabindex tabindex/next;" 
                       />
            </div>
        </div>

        <div class="row" 
             tal:condition="not: allowEnterPassword"
             tal:define="error_confirm errors/confirm | nothing;
                         confirm request/confirm | nothing;" >
                         
            <div class="label required">
                <span i18n:translate="label_confirm_password">Confirm <br />Password</span>
                <div id="confirm_password_help" 
                     i18n:translate="help_confirm_password"
                     class="help" 
                     style="visibility:hidden">
                Re-enter the password. Make sure the passwords are identical.
                </div>
            </div>
            
            <div class="field"
                 tal:attributes="class python:test(error_confirm, 'field error', 'field')" >
                <div tal:condition="error_confirm">
                    <tal:block i18n:translate="" content="error_confirm">Error</tal:block>
                    <br />
                </div>

                <input type="password" 
                       name="confirm" 
                       size="10" 
                       value="" 
                       tabindex=""
                       onfocus="formtooltip('confirm_password_help',1)" 
                       onblur="formtooltip('confirm_password_help',0)" 
                       tal:attributes="value confirm;
                                       tabindex tabindex/next;"
                       />
            </div>
        </div>

        <div class="row" tal:condition="not: allowEnterPassword" tal:define="mail_me request/mail_me|nothing">
                        
            <div class="label">
                <span i18n:translate="label_mail_password">Mail Password?</span>
                <div id="mail_password_help" 
                     i18n:translate="help_mail_password"
                     class="help" 
                     style="visibility:hidden">
                Check this box to have your password 
                delivered to your mailbox, so you won't lose it.
                </div>
            </div>
            
            <div class="field">
                <input type="checkbox" 
                       class="noborder" 
                       name="mail_me" 
                       size="30" 
                       id="cb_mailme" 
                       tabindex=""
                       onfocus="formtooltip('mail_password_help',1)" 
                       onblur="formtooltip('mail_password_help',0)" 
                       tal:attributes="checked python:test(mail_me, 'checked', None);
                                       tabindex tabindex/next;" 
                       />
                <label for="cb_mailme" i18n:translate="label_yes_mail_me_password">Yes, mail me my password</label>
            </div>
        </div>

        <div class="row" tal:condition="allowEnterPassword">
            <div class="label"></div>
            <div class="field" i18n:translate="label_password_will_be_mailed">
            A password will be generated and 
            e-mailed to you to complete the registration process.
            </div>
        </div>

        <div class="row"
             tal:define="props here/portal_membership/getUserSearchableAttributes"
             tal:repeat="prop props">

            <div class="label"
                 tal:condition="python: prop[0] != 'mail'">
                <span tal:content="python: prop[1]"> Property Name </span>
            </div>

            <div class="field"
                 tal:define="prop_id python: prop[0];
                             prop_val request/?prop_id|nothing"
                 tal:condition="python: prop_id != 'mail'">
                <input type="text"
                       name=""
                       size="30"
                       tabindex=""
                       tal:attributes="name prop_id;
                                       value prop_val;
                                       tabindex tabindex/next;" 
                />
            </div>

        </div>

        <div class="row">
            <div class="label">&nbsp;</div>
            <div class="field">
                <input class="context" 
                       type="submit"
                       tabindex="" 
                       name="submit" 
                       value="Register"
                       i18n:attributes="value"
                       tal:attributes="tabindex tabindex/next;" />
            </div>
        </div>

        <span tal:replace="nothing">
        ##### HIDDEN VARIABLES FOR THE FORM_TOOL -- CUT AND PASTE THESE INTO YOUR FORM ####
        </span>
        <input type="hidden" name="form_submitted" value="1" tal:attributes="value template/id" />

    </form>
</div>

</body>
</html>



=== Products/ZopeOrg-NV/skins/nzo/personalize.py 1.2 => 1.3 ===
+## Script (Python) "personalize"
+##title=Personalization Handler.
+##parameters=
+REQUEST=context.REQUEST
+member = context.portal_membership.getAuthenticatedMember()
+
+failMessage = context.portal_registration.testPropertiesValidity(REQUEST,
+                                                                 member)
+if failMessage:
+    REQUEST.set('portal_status_message', failMessage)
+    return context.personalize_form(context, REQUEST,
+                                    portal_status_message=failMessage)
+
+member.setProperties(REQUEST)
+
+if REQUEST.has_key('portal_skin'):
+    context.portal_skins.updateSkinCookie()
+
+qs = '/personalize_form?portal_status_message=Member+changed.'
+
+context.REQUEST.RESPONSE.redirect(context.portal_url() + qs)


=== Added File Products/ZopeOrg-NV/skins/nzo/personalize_form.pt ===
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
      lang="en-US"
      metal:use-macro="here/main_template/macros/master"
      i18n:domain="plone">

<tal:block metal:fill-slot="base">
   <tal:block tal:define="dummy python:request.set('disable_border',1)" />
</tal:block>

<body>
			
<div metal:fill-slot="main"
     tal:define="errors python:request.get('errors', {})"
     tal:condition="here/rejectAnonymous" >

    
    <span tal:define="dummy python:request.response.setHeader('pragma','no-cache')" />

    <h1 i18n:translate="heading_my_preferences">My Preferences</h1>

    <p> 
        <a href="password_form" i18n:translate="description_click_to_change_password">Click here to change your password.</a> 
    </p>
      
  
    <metal:block tal:condition="not: here/portal_membership/isAnonymousUser"
                 tal:define="member container/portal_membership/getAuthenticatedMember | nothing">

        <form class="group"
              action="personalize" 
              method="post"
              enctype="multipart/form-data" 
              tal:condition="member">
        
            <span class="legend" i18n:translate="legend_member_details">Member Details</span>

            <div class="row"
                 tal:replace="nothing"
                 tal:define="error_fullname errors/fullname | nothing;
                             fullname request/full_name'|member/full_name|nothing;">
                
                <div class="label">
                    <span i18n:translate="label_full_name">Full name</span>

                    <div id="full_name_help"
                         i18n:translate="help_full_name" 
                         class="help" 
                         style="visibility:hidden">
                    You can change your full name here.
                    </div>
                </div>
                
                <div class="field" tal:attributes="class python:test(error_fullname, 'field error', 'field')"> 
                    
                    <div tal:condition="error_fullname">
                        <tal:block i18n:translate="" content="error_fullname">Error</tal:block>
                        <br />
                    </div>
                    
                    <input type="text" 
                           name="fullname" 
                           size="25"
                           tabindex=""
                           value="member.fullname html_quote"
                           onfocus="formtooltip('full_name_help',1)" 
                           onblur="formtooltip('full_name_help',0)" 
                           tal:attributes="value fullname;
                                           tabindex tabindex/next;" 
                           />
                </div>

            </div>
		
            <div class="row"
                 tal:define="error_email errors/email | nothing;
                             email python:request.get('email', member.getProperty('email'));">
                
                <div class="label required">
                    <span i18n:translate="label_email">E-mail</span>

                    <div id="new_email_help"
                         i18n:translate="help_new_email" 
                         class="help" 
                         style="visibility:hidden">
                    Enter your new e-mail address here, if you want to change it.
                    </div>
                </div>
                
                <div class="field" tal:attributes="class python:test(error_email, 'field error', 'field')"> 
                    <div tal:condition="error_email">
                        <tal:block i18n:translate="" content="error_email">Error</tal:block>
                        <br />
                    </div>
                    
                    <input type="text" 
                           name="email" 
                           size="25"
                           tabindex=""
                           value="member.email html_quote"
                           onfocus="formtooltip('new_email_help',1)" 
                           onblur="formtooltip('new_email_help',0)" 
                           tal:attributes="value email;
                                           tabindex tabindex/next;" 
                           />
                </div>

            </div>

            <div class="row"
                 tal:replace="nothing">
                <div class="label">
                    <span i18n:translate="label_content_editor">Content editor</span>
                    
                    <div id="wysiwyg_editor_help"
                         i18n:translate="help_content_editor"
                         class="help"
                         style="visibility:hidden">
                    Select the editor that you would like to use for editing
                    content more easily. Content editors
                    often have specific browser requirements.
                    </div>
                </div>
                <div class="field"
                     tal:define="wysiwyg_editor request/wysiwyg_editor|member/wysiwyg_editor|nothing">
                     <select name="wysiwyg_editor"
                             onfocus="formtooltip('wysiwyg_editor_help',1)"
                             onblur="formtooltip('wysiwyg_editor_help',0)"
                             tabindex=""
                             tal:attributes="tabindex tabindex/next;">
                         <tal:block tal:repeat="editor site_properties/available_editors">
                         <option tal:condition="python:editor != 'None'"
                                 value="None"
                                 tal:attributes="value editor;
                                                 selected python:test(editor==wysiwyg_editor, 'selected', None);"
                                 tal:content="editor">
                         WYSIWYG-editor
                         </option>
                         <option tal:condition="python:editor == 'None'"
                                 value="None"
                                 tal:attributes="value editor;
                                                 selected python:test(editor==wysiwyg_editor, 'selected', None);"
                                 tal:content="editor"
                                 i18n:translate="label_ordinary_content_editor">
                         Ordinary Form-based Editor (works in all browsers)
                         </option>

                         </tal:block>
                     </select>
                </div>
             </div>

            <div class="row"
                 tal:define="props here/portal_membership/getUserSearchableAttributes"
                 tal:repeat="prop props">

                <div class="label"
                     tal:condition="python: prop[0] != 'mail'">
                    <span tal:content="python: prop[1]"> Property Name </span>
                </div>

                <div class="field"
                     tal:define="prop_id python: prop[0];
                                 prop_val request/?prop_id|member/?prop_id|nothing"
                     tal:condition="python: prop_id != 'mail'">
                    <input type="text"
                           name=""
                           size="30"
                           tabindex=""
                           tal:attributes="name prop_id;
                                           value prop_val;
                                           tabindex tabindex/next;"
                    />
                </div>

            </div>
             
            <div class="row">
                <div class="label">
                    <span i18n:translate="label_listed_status">Listed status</span>

                    <div id="listed_status_help"
                         i18n:translate="help_listed_status" 
                         class="help" 
                         style="visibility:hidden">
                    Select whether you want to be listed on the public membership listing
                    or not.	Remember that your Member folder will still be publicly accessible unless
                    you change its security settings, even if you select 'unlisted' here.
                    </div>                
                </div>
                <div class="field"
		                 tal:define="listed_str request/listed|member/listed|string:0;
                                     listed python: int(listed_str);
                                 tabindex tabindex/next;">
                    <input type="radio" 
                           class="noborder" 
                           name="listed" 
                           value="on"
                           id="cb_listed" 
                           checked="checked"
                           tabindex=""
                           onfocus="formtooltip('listed_status_help',1)" 
                           onblur="formtooltip('listed_status_help',0)"
                           tal:attributes="tabindex tabindex;" 
                           tal:condition="listed" 
                           />
                           
                    <input type="radio" 
                           class="noborder" 
                           name="listed" 
                           value="on"
                           id="cb_listed"
                           tabindex=""
                           onfocus="formtooltip('listed_status_help',1)" 
                           onblur="formtooltip('listed_status_help',0)"
                           tal:attributes="tabindex tabindex;" 
                           tal:condition="not: listed" 
                           />
                    
                    <label for="cb_listed" i18n:translate="label_member_listed">Listed</label>
                    
                    <br />
                    
                    <input type="radio" 
                           class="noborder" 
                           name="listed" 
                           value=""
                           id="cb_unlisted"
                           tabindex=""
                           onfocus="formtooltip('listed_status_help',1)" 
                           onblur="formtooltip('listed_status_help',0)"
                           tal:attributes="tabindex tabindex;" 
                           tal:condition="listed" 
                           />
                    
                    <input type="radio" 
                           class="noborder" 
                           name="listed" 
                           value=""
                           id="cb_unlisted" 
                           checked="checked"
                           tabindex=""
                           onfocus="formtooltip('listed_status_help',1)" 
                           onblur="formtooltip('listed_status_help',0)"
                           tal:attributes="tabindex tabindex;" 
                           tal:condition="not: listed " 
                           />		   
                    
                    <label for="cb_unlisted" i18n:translate="label_member_unlisted">Unlisted</label>
                </div>
            </div>

            <div class="row">
                <div class="label">
                    <span i18n:translate="label_form_help">Form Help</span>

                    <div id="formtooltips_help"
                         i18n:translate="help_form_help" 
                         class="help" 
                         style="visibility:hidden">
                    Select whether you want form help pop-ups to be displayed.
                    </div>                
                </div>
                <div class="field"
                     tal:define="formtooltips request/formtooltips|member/formtooltips|nothing;
                     tabindex tabindex/next;"> 
                    <input type="radio" 
                           class="noborder" 
                           name="formtooltips" 
                           value="on"
                           id="cb_formtooltips" 
                           checked="checked"
                           tabindex=""
                           onfocus="formtooltip('formtooltips_help',1)" 
                           onblur="formtooltip('formtooltips_help',0)"
                           tal:attributes="tabindex tabindex;" 
                           tal:condition="formtooltips" 
                           />
                           
                    <input type="radio" 
                           class="noborder" 
                           name="formtooltips" 
                           value="on"
                           id="cb_formtooltips"
                           tabindex=""
                           onfocus="formtooltip('formtooltips_help',1)" 
                           onblur="formtooltip('formtooltips_help',0)"
                           tal:attributes="tabindex tabindex;" 
                           tal:condition="not: formtooltips" 
                           />
                    
                    <label for="cb_formtooltips" i18n:translate="yes">Yes</label>
                    
                    <br />
                    
                    <input type="radio" 
                           class="noborder" 
                           name="formtooltips" 
                           value=""
                           id="cb_noformtooltips"
                           tabindex=""
                           onfocus="formtooltip('formtooltips_help',1)" 
                           onblur="formtooltip('formtooltips_help',0)"
                           tal:attributes="tabindex tabindex;"
                           tal:condition="formtooltips" 
                           />
                    
                    <input type="radio" 
                           class="noborder" 
                           name="formtooltips" 
                           value=""
                           id="cb_noformtooltips" 
                           checked="checked"
                           tabindex=""
                           onfocus="formtooltip('formtooltips_help',1)" 
                           onblur="formtooltip('formtooltips_help',0)"
                           tal:attributes="tabindex tabindex;" 
                           tal:condition="not: formtooltips" 
                           />		   
                    
                    <label for="cb_noformtooltips" i18n:translate="no">No</label>
                </div>
            </div>


            <div class="row" tal:replace="nothing">
                <div class="label">
                    <span i18n:translate="label_display_names">Display Names</span>

                    <div id="visible_ids_help"
                         i18n:translate="help_display_names" 
                         class="help" 
                         style="visibility:hidden">
                    Select whether you want Names (also known as IDs) to be 
                    visible and editable when editing contents. If you choose not
                    to display Names, they will be generated automatically.
                    </div>                
                </div>
                <div class="field"
           	         tal:define="visible_ids request/visible_ids|member/visible_ids|nothing;
                                 tabindex tabindex/next;"> 
                    <input type="radio" 
                           class="noborder" 
                           name="visible_ids" 
                           value="on"
                           id="cb_visible_ids" 
                           checked="checked"
                           tabindex=""
                           onfocus="formtooltip('visible_ids_help',1)" 
                           onblur="formtooltip('visible_ids_help',0)"
                           tal:attributes="tabindex tabindex;" 
                           tal:condition="visible_ids" 
                           />
                           
                    <input type="radio" 
                           class="noborder" 
                           name="visible_ids" 
                           value="on"
                           id="cb_visible_ids"
                           tabindex=""
                           onfocus="formtooltip('visible_ids_help',1)" 
                           onblur="formtooltip('visible_ids_help',0)" 
                           tal:attributes="tabindex tabindex;" 
                           tal:condition="not: visible_ids" 
                           />
                    
                    <label for="cb_visible_ids" i18n:translate="yes">Yes</label>
                    
                    <br />
                    
                    <input type="radio" 
                           class="noborder" 
                           name="visible_ids" 
                           value=""
                           id="cb_invisibleids"
                           tabindex=""
                           onfocus="formtooltip('visible_ids_help',1)" 
                           onblur="formtooltip('visible_ids_help',0)" 
                           tal:attributes="tabindex tabindex;" 
                           tal:condition="visible_ids" 
                           />
                    
                    <input type="radio" 
                           class="noborder" 
                           name="visible_ids" 
                           value=""
                           id="cb_invisible_ids" 
                           checked="checked"
                           tabindex=""
                           onfocus="formtooltip('visible_ids_help',1)" 
                           onblur="formtooltip('visible_ids_help',0)" 
                           tal:attributes="tabindex tabindex;" 
                           tal:condition="not: visible_ids" 
                           />		   
                    
                    <label for="cb_invisible_ids" i18n:translate="no">No</label>
                </div>
            </div>


            <div class="row" 
                 tal:condition="here/portal_skins/allow_any">
                
                <div class="label">
                    <span i18n:translate="label_look">Look</span>
                    <div id="skin_help"
                         i18n:translate="help_look" 
                         class="help" 
                         style="visibility:hidden">
                    Here you choose the appearance of the site. Several styles are available.
                    </div>
                </div>
                
                <div class="field"
		     tal:define="skinvar python:request.get(here.portal_skins.getRequestVarname(), '');
                         skindefault here/portal_skins/getDefaultSkin;
                         skincurrent python:test(skinvar, skinvar, skindefault);"> 
                    <select name="portal_skin"
                            tabindex=""
                            onfocus="formtooltip('skin_help',1)" 
                            onblur="formtooltip('skin_help',0)"
                            tal:attributes="tabindex tabindex/next;" 
                            >
                    <option value="#"
                            i18n:translate=""
                            tal:repeat="skin container/portal_skins/getSkinSelections"
                            tal:attributes="value skin;
                                            selected python:test(skincurrent==skin, 'selected', None);"
                            tal:content="skin"
                            >dummy skin</option>
                    </select>
                </div>
            </div>

            <div tal:replace="nothing">
            <div class="row"
                 tal:define="portrait python:here.portal_membership.getPersonalPortrait(member.getId());
                             personal python:here.portal_membership.getPersonalFolder(member.getId());"
                 tal:condition="personal">
                <div class="label">
                    <span i18n:translate="label_portrait">Portrait</span>
                    <div id="portrait_help"
                         i18n:translate="help_portrait" 
                         class="help" 
                         style="visibility:hidden">
                    To add a new portrait, click the <strong>Browse</strong> button and select
                    a picture of yourself. Recommended size is 75 pixels wide, 100 pixels tall. <br />
                    </div>
                    
                </div>
                <div class="field"> 

                    <input type="file" 
                           name="portrait" 
                           size="20" 
                           tabindex=""
                           onfocus="formtooltip('portrait_help',1)" 
                           onblur="formtooltip('portrait_help',0)"
                           tal:attributes="tabindex tabindex/next;" 
                           />
                    <br />
                    
                    <img src="" 
                         height="100"
                         width="75"
                         style="border: 1px solid black" 
                         tal:condition="portrait"
                         tal:attributes="src portrait/absolute_url" 
                         />
                </div>
            </div>
            </div>

            <div class="row">
                <div class="label">&nbsp;</div>
                <div class="field">
                    <input class="context"
                           tabindex="" 
                           type="submit" 
                           value="Save" 
                           i18n:attributes="value"
                           tal:attributes="tabindex tabindex/next;" 
                           />
                </div>
            </div>
            
            <input type="hidden" name="form_submitted" value="1" tal:attributes="value template/id" />
                        
		</form>
    </metal:block>
	
    
</div>
	   
</body>
</html>



=== Products/ZopeOrg-NV/skins/nzo/main_template.pt 1.4 => 1.5 ===
         wf_actions actions/workflow;
         folder_actions actions/folder;
         local_actions python:actions.get('object_tabs', []);
-        isFolder python:test(here.getTypeInfo().getId() in site_properties.use_folder_tabs,1,0);
+        typ here/getTypeInfo|nothing;
+        isFolder python:test(typ and typ.getId() in site_properties.use_folder_tabs,1,0);
         template_id options/template_id|template_id|template/getId|nothing;
         slots_mapping options/slots_mapping|here/prepare_slots|nothing;
         Iterator python:modules['Products.CMFPlone'].IndexIterator;


=== Products/ZopeOrg-NV/skins/nzo/register.py 1.1 => 1.2 ===
 ## Script (Python) "register"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
+##title=Register a user
+##bind namespace=_
 ##parameters=password='password', confirm='confirm'
-##title=Register a User
-##
 REQUEST=context.REQUEST
-
-# add LDAP attributes
-REQUEST = context.add_ldap_attributes(REQUEST)
 errors = {}
 
-portal_registration=context.portal_registration
-site_properties=context.portal_properties.site_properties
-
-username = REQUEST['username']
-
-password=REQUEST.get('password') or portal_registration.generatePassword()
-portal_registration.addMember(username, password, properties=REQUEST)
-
-if site_properties.validate_email or REQUEST.get('mail_me', 0):
-    try:
-        portal_registration.registeredNotify(username)
-    except:
-        context.plone_utils.logException()
-        exception = context.plone_utils.exceptionString()
-        errors['email'] = 'We were unable to send your password to this address.'
-        return ('failure', context, {'portal_status_message':exception,
-                                     'errors':errors,
-                                     'came_from':context.REQUEST.get('came_from','logged_in')})
+portal_registration = context.portal_registration
+site_properties = context.portal_properties.site_properties
 
-return ('success', context, {'portal_status_message':context.REQUEST.get('portal_status_message', 'Registered.'),\
-                             'came_from':context.REQUEST.get('came_from','logged_in')})
+email = REQUEST.get('mail', '') or REQUEST.get('email', '') or ''
+REQUEST.set('email', email)
+REQUEST.form['mail'] = email
+
+if not site_properties.validate_email:
+    failMessage = portal_registration.testPasswordValidity(password, confirm)
+    if failMessage:
+        REQUEST.set( 'error', failMessage )
+        return context.join_form( context, REQUEST, error=failMessage )
+      
+failMessage = portal_registration.testPropertiesValidity(REQUEST)
+
+if failMessage:
+    REQUEST.set( 'error', failMessage )
+    return context.join_form( context, REQUEST, error=failMessage )
+
+else:
+    password=REQUEST.get('password') or portal_registration.generatePassword()
+    portal_registration.addMember(REQUEST['username'], password, properties=REQUEST)
+
+    if site_properties.validate_email or REQUEST.get('mail_me', 0):
+        portal_registration.registeredNotify(REQUEST['username'])
+
+    msg = REQUEST.get('portal_status_message', 'Registered.')
+
+    #return context.registered( context, REQUEST )
+    return ( 'success'
+           , context
+           , { 'portal_status_message' : msg
+             , 'came_from' : REQUEST.get('came_from','logged_in')
+             }
+           )





More information about the zopeorg-checkins mailing list