<html xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      metal:use-macro="here/main_template/macros/master">
<body>
<div metal:fill-slot="main">
<div class="Desktop"
     tal:define="mtool here/portal_membership;
                 member mtool/getAuthenticatedMember;
                 ptool here/portal_properties;
                ">

<h1>Become a member</h1>

<div tal:define="registered python:member.has_role('Member')">

 <div tal:condition="registered">

  <p> You are already a member. You may use the
      <a href="personalize_form">personalization form</a> 
       to change your membership information. </p>

 </div><!-- registered -->

 <div tal:condition="not: registered">

  <p> Becoming a member gives you the ability to personalize the site
      and participate in the community.</p>

  <p> It does not cost any money to become a member and your email and
      other personal information will remain private.</p>

  <p tal:condition="python: ptool.validate_email">
      You must submit a valid email address. This address will be used
      to send you a randomly-generated password.  Once you have logged
      in with this password, you may change it to anything you like.</p>

  <div class="DesktopStatusBar"
       tal:content="request/error|nothing">
     <hr>
  </div>

  <form action="register" method="POST"
        tal:attributes="action string:${here/portal_url}/register"
  >

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

   <table class="FormLayout">

    <tr>
     <th> Login Name </th>
     <td>
      <input type="text" name="username" size="30" value=""
             tal:attributes="value request/username|nothing">
     </td>
    </tr>

    <tr>
     <th> Email Address </th>
     <td align="left" valign="top">
      <input type="text" name="email" size="30" value=""
          tal:attributes="value request/email|nothing">
     </td>
    </tr>

   <tbody tal:condition="python: not(ptool.validate_email)">

    <tr>
     <th> Password </th>
     <td align="left" valign="top">
      <input type="password" name="password" size="30">
     </td>
    </tr>

    <tr>
     <th> Password (confirm) </th>
     <td align="left" valign="top">
      <input type="password" name="confirm" size="30">
     </td>
    </tr>

    <tr>
     <th> Mail Password?  </th>
     <td>
      <input type="checkbox" name="mail_me" size="30" id="cb_mailme" />
      <em><label for="cb_mailme">Check this box to have your password 
                                 mailed to you.</label></em>
     </td>
    </tr>
   </tbody>

    <tr>
     <td><br></td>
     <td> <input type="submit" name="submit" value="Register"> </td>
    </tr>

   </table>

  </form>

 </div><!-- not registered -->

</div><!-- tal:define="registered" -->

</div><!-- class="Desktop" -->

</div><!-- metal:fill-slot="main" -->

</body>
</html>