Changeset 631
- Timestamp:
- 11/17/06 09:57:27
- Files:
-
- qPloneComments/trunk/skins/qplonecomments/2.1/discussion_reply_form.cpt (modified) (5 diffs)
- qPloneComments/trunk/skins/qplonecomments/2.1/validate_talkback.vpy (modified) (2 diffs)
- qPloneComments/trunk/skins/qplonecomments/2.5/discussion_reply_form.cpt (modified) (1 diff)
- qPloneComments/trunk/skins/qplonecomments/2.5/validate_talkback.vpy (modified) (3 diffs)
- qPloneComments/trunk/skins/qplonecomments/validate_reply.vpy (modified) (1 diff)
- qPloneComments/trunk/version.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneComments/trunk/skins/qplonecomments/2.1/discussion_reply_form.cpt
r630 r631 14 14 thread python:putils.getDiscussionThread(here); 15 15 discussable python:thread[0]; 16 replies python:thread[1:]"> 16 replies python:thread[1:]; 17 property_id string:require_email; 18 props_sheet here/portal_properties/qPloneComments; 19 require_email python:props_sheet.getProperty(property_id)"> 17 20 18 21 <tal:discussable define="template python:getattr(here, discussable.getLayout(), None); … … 20 23 main_macro macros/main | nothing; 21 24 showDiscussable python:main_macro; 22 template template_id" 23 > 25 template template_id"> 24 26 25 27 <div class="comment" … … 65 67 66 68 <fieldset> 69 <input type="hidden" name="require_email" value="" 70 tal:attributes="value python:bool(require_email and isAnon)"/> 67 71 68 72 <legend i18n:translate="legend_add_comment">Add comment</legend> … … 110 114 </div> 111 115 </div> 112 <div class="field" 113 tal:define="property_id string:require_email; 114 props_sheet here/portal_properties/qPloneComments" 115 tal:condition="python:props_sheet.getProperty(property_id) and isAnon"> 116 117 <label for="user_email" i18n:translate="label_discussion-manager_email">Please enter your email:</label> 116 <div class="field" 117 tal:define="error errors/email|nothing;" 118 tal:attributes="class python:test(error, 'field error', 'field')" 119 tal:condition="python:require_email and isAnon"> 120 121 122 <label for="email" i18n:translate="label_discussion-manager_email">Please enter your email:</label> 118 123 <span class="fieldRequired" title="Required" 119 124 i18n:attributes="title title_required;" 120 125 i18n:translate="label_required">(Required) 121 126 </span> 122 <div tal:content=" string:">Validation error output</div>123 124 <input name=" user_email"127 <div tal:content="error">Validation error output</div> 128 129 <input name="email" 125 130 value="" 126 131 size="40" … … 218 223 219 224 </div> 225 226 <div tal:condition="here/captcha_widget|nothing" 227 tal:omit-tag=""> 228 <div metal:use-macro="here/captcha_widget/macros/captcha" /> 229 </div> 220 230 221 231 <div class="formControls"> qPloneComments/trunk/skins/qplonecomments/2.1/validate_talkback.vpy
r630 r631 6 6 ##bind state=state 7 7 ##bind subpath=traverse_subpath 8 ##parameters=subject='',body_text='' 8 ##parameters=subject='',body_text='',require_email, email='' 9 9 ##title=validates a discussion entry 10 10 ## … … 24 24 if not body_text: 25 25 state.setError('body_text', 'Please submit a body.', 'body_required') 26 27 if require_email != 'False': 28 if not (email and context.portal_registration.isValidEmail(email)): 29 state.setError('email', 'Please submit email.', 'email_required') 30 31 if hasattr(context, 'captcha_validator'): 32 context.captcha_validator() 26 33 27 34 pp = getToolByName(context, 'portal_properties') qPloneComments/trunk/skins/qplonecomments/2.5/discussion_reply_form.cpt
r630 r631 224 224 </div> 225 225 226 <div tal:condition="here/captcha_widget|nothing" 227 tal:omit-tag=""> 228 <div metal:use-macro="here/captcha_widget/macros/captcha" /> 229 </div> 230 226 231 <div class="formControls"> 227 232 qPloneComments/trunk/skins/qplonecomments/2.5/validate_talkback.vpy
r630 r631 10 10 from Products.CMFCore.utils import getToolByName 11 11 from Products.CMFPlone import PloneMessageFactory as _ 12 13 12 dtool = context.portal_discussion 14 13 try: … … 16 15 except AttributeError: 17 16 content = context 17 18 18 if not dtool.isDiscussionAllowedFor(content): 19 19 raise Exception, "Discussion not allowed." … … 28 28 if not (email and context.portal_registration.isValidEmail(email)): 29 29 state.setError('email', 'Please submit email.', 'email_required') 30 31 if hasattr(context, 'captcha_validator'): 32 context.captcha_validator() 30 33 31 34 pp = getToolByName(context, 'portal_properties') qPloneComments/trunk/skins/qplonecomments/validate_reply.vpy
r630 r631 13 13 14 14 return state 15 qPloneComments/trunk/version.txt
r630 r631 1 2.2.0 -RC11 2.2.0
