[Checkins] SVN: Products.CMFDefault/trunk/Products/CMFDefault/browser/membership/ Initial implementation of a join view.
Charlie Clark
charlie at begeistert.org
Sun Jun 27 05:19:13 EDT 2010
Log message for revision 113911:
Initial implementation of a join view.
Changed:
A Products.CMFDefault/trunk/Products/CMFDefault/browser/membership/join.py
A Products.CMFDefault/trunk/Products/CMFDefault/browser/membership/templates/join.pt
-=-
Added: Products.CMFDefault/trunk/Products/CMFDefault/browser/membership/join.py
===================================================================
--- Products.CMFDefault/trunk/Products/CMFDefault/browser/membership/join.py (rev 0)
+++ Products.CMFDefault/trunk/Products/CMFDefault/browser/membership/join.py 2010-06-27 09:19:13 UTC (rev 113911)
@@ -0,0 +1,76 @@
+"""
+Join form
+$Id$
+"""
+
+from zope.formlib import form
+from zope.interface import Interface
+from zope.schema import ASCIILine, Password, Bool
+
+from Products.CMFDefault.formlib.form import EditFormBase
+from Products.CMFDefault.formlib.schema import EmailLine
+
+from Products.CMFDefault.utils import Message as _
+
+class IZopeChooseSchema(Interface):
+ """Zope generates password and sends it by e-mail"""
+
+ member_id = ASCIILine(
+ title=_(u"Member ID")
+ )
+
+ email = EmailLine(
+ title=_(u"E-mail address")
+ )
+
+class IUserChooseSchema(IZopeChooseSchema):
+ """User is allowed to set their own e-mail"""
+
+ password = Password(
+ title=_(u"Password")
+ )
+
+ password_confirmation = Password(
+ title=_(u"Password (confirm)")
+ )
+
+ send_password = Bool(
+ title=_(u"Mail Password?"),
+ description=_(u"Check this box to have the password mailed."))
+
+
+class Join(EditFormBase):
+
+ actions = form.Actions(
+ form.Action(
+ name='register',
+ label=_(u'Register'),
+ validator='handle_register_validate',
+ success='handle_success',
+ failure='handle_failure'),
+ form.Action(
+ name='cancel',
+ label=_(u'Cancel')
+ )
+ )
+
+ def __init__(self, context, request):
+ super(Join, self).__init__(context, request)
+ ptool = self._getTool("portal_properties")
+ validate = ptool.getProperty('validate_email')
+ if validate:
+ self.form_fields = form.FormFields(IZopeChooseSchema)
+ else:
+ self.form_fields = form.FormFields(IUserChooseSchema)
+
+ def add_member(self, data):
+ """add member"""
+
+ def send_password(self):
+ """send password"""
+
+ def handle_success(self, action, data):
+ """"""
+
+ def handle_failure(self, action, data):
+ pass
Property changes on: Products.CMFDefault/trunk/Products/CMFDefault/browser/membership/join.py
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: Products.CMFDefault/trunk/Products/CMFDefault/browser/membership/templates/join.pt
===================================================================
--- Products.CMFDefault/trunk/Products/CMFDefault/browser/membership/templates/join.pt (rev 0)
+++ Products.CMFDefault/trunk/Products/CMFDefault/browser/membership/templates/join.pt 2010-06-27 09:19:13 UTC (rev 113911)
@@ -0,0 +1,17 @@
+<html metal:use-macro="context/main_template/macros/master">
+<body>
+
+<metal:slot metal:fill-slot="body" i18n:domain="cmf_default">
+ <h1 i18n:translate="">Become a Member</h1>
+
+ <p i18n:translate="">Becoming a member gives you the ability to personalize the site and participate in the community.</p>
+
+ <p i18n:translate="">It does not cost any money to become a member and your email and other personal information will remain private.</p>
+
+<metal:macro metal:use-macro="view/base_template/macros/form" />
+
+
+</metal:slot>
+
+</body>
+</html>
More information about the checkins
mailing list