Changeset 632
- Timestamp:
- 11/17/06 11:34:49
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneComments/trunk/skins/qplonecomments/2.0.5/discussion_reply_form.cpt
r631 r632 9 9 10 10 <div metal:fill-slot="main" 11 tal:define="errors options/state/getErrors;"> 11 tal:define="errors options/state/getErrors; 12 property_id string:require_email; 13 props_sheet here/portal_properties/qPloneComments; 14 require_email python:props_sheet.getProperty(property_id)"> 12 15 13 16 <h1 i18n:translate="heading_add_comment">Add Comment</h1> … … 23 26 tal:define="isForAnonymous python:here.portal_properties.qPloneComments.getProperty('enable_anonymous_commenting', 0)"> 24 27 <fieldset> 28 <input type="hidden" name="require_email" value="" 29 tal:attributes="value python:bool(require_email and isAnon)"/> 30 25 31 <legend i18n:translate="legend_comment_details">Comment Details</legend> 26 32 … … 63 69 64 70 </div> 65 66 <div class="field"67 tal:define="property_id string:require_email;68 props_sheet here/portal_properties/qPloneComments"69 tal:condition="python:props_sheet.getProperty(property_id) and isAnon"> 70 71 <label for="user_email" i18n:translate="label_discussion-manager_email">Please enter your email:</label>72 <span class="fieldRequired" title="Required"73 i18n:attributes="title title_required;"74 i18n:translate="label_required">(Required)75 </span>76 <div tal:content="string:">Validation error output</div>77 78 <input name="user_email"79 value=""80 size="40"81 tabindex=""82 tal:attributes="tabindex tabindex/next;" />83 </div>71 <div class="field" 72 tal:define="error errors/email|nothing;" 73 tal:attributes="class python:test(error, 'field error', 'field')" 74 tal:condition="python:require_email and isAnon"> 75 76 77 <label for="email" i18n:translate="label_discussion-manager_email">Please enter your email:</label> 78 <span class="fieldRequired" title="Required" 79 i18n:attributes="title title_required;" 80 i18n:translate="label_required">(Required) 81 </span> 82 <div tal:content="error">Validation error output</div> 83 84 <input name="email" 85 value="" 86 size="40" 87 tabindex="" 88 tal:attributes="tabindex tabindex/next;" /> 89 </div> 84 90 85 91 </div> … … 184 190 </div> 185 191 192 <div tal:condition="here/captcha_widget|nothing" 193 tal:omit-tag=""> 194 <div metal:use-macro="here/captcha_widget/macros/captcha" /> 195 </div> 196 186 197 <div class="formControls"> 187 198 qPloneComments/trunk/skins/qplonecomments/2.0.5/validate_talkback.vpy
r631 r632 6 6 ##bind state=state 7 7 ##bind subpath=traverse_subpath 8 ##parameters=subject='',body_text='' 8 ##parameters=subject='',body_text='', email='', require_email 9 9 ##title=validates a discussion entry 10 10 ## … … 17 17 state.setError('body_text', 'Please submit a body.', 'body_required') 18 18 19 if require_email != 'False': 20 if not (email and context.portal_registration.isValidEmail(email)): 21 state.setError('email', 'Please submit email.', 'email_required') 22 23 if hasattr(context, 'captcha_validator'): 24 context.captcha_validator() 25 19 26 pp = getToolByName(context, 'portal_properties') 20 27 isForAnonymous = pp['qPloneComments'].getProperty('enable_anonymous_commenting', None) qPloneComments/trunk/skins/qplonecomments/2.1/discussion_reply_form.cpt
r631 r632 223 223 224 224 </div> 225 225 226 226 <div tal:condition="here/captcha_widget|nothing" 227 227 tal:omit-tag=""> 228 <div metal:use-macro="here/captcha_widget/macros/captcha" />228 <div metal:use-macro="here/captcha_widget/macros/captcha" /> 229 229 </div> 230 230
