Changeset 627
- Timestamp:
- 11/16/06 08:21:58
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneComments/trunk/skins/qplonecomments/2.5/discussion_reply_form.cpt
r626 r627 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); … … 53 56 This is the body text of the comment. 54 57 </div> 55 </div> 56 58 </div> 59 57 60 </tal:block> 58 61 </tal:thread> … … 65 68 66 69 <fieldset> 70 <input type="hidden" name="require_email" value="" 71 tal:attributes="value require_email"/> 67 72 68 73 <legend i18n:translate="legend_add_comment">Add comment</legend> … … 112 117 113 118 <div class="field" 114 tal:define="property_id string:require_email; 115 props_sheet here/portal_properties/qPloneComments" 116 tal:condition="python:props_sheet.getProperty(property_id) and isAnon"> 117 118 <label for="user_email" i18n:translate="label_discussion-manager_email">Please enter your email:</label> 119 tal:define="error errors/email|nothing;" 120 tal:attributes="class python:test(error, 'field error', 'field')" 121 tal:condition="python:require_email and isAnon"> 122 123 124 <label for="email" i18n:translate="label_discussion-manager_email">Please enter your email:</label> 119 125 <span class="fieldRequired" title="Required" 120 126 i18n:attributes="title title_required;" 121 127 i18n:translate="label_required">(Required) 122 128 </span> 123 <div tal:content=" string:">Validation error output</div>124 125 <input name=" user_email"129 <div tal:content="error">Validation error output</div> 130 131 <input name="email" 126 132 value="" 127 133 size="40" qPloneComments/trunk/skins/qplonecomments/2.5/validate_talkback.vpy
r626 r627 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 from Products.CMFCore.utils import getToolByName … … 25 25 state.setError('body_text', 'Please submit a body.', 'body_required') 26 26 27 if require_email: 28 if not (email and context.portal_registration.isValidEmail(email)): 29 state.setError('email', 'Please submit email.', 'email_required') 30 27 31 pp = getToolByName(context, 'portal_properties') 28 32 isForAnonymous = pp['qPloneComments'].getProperty('enable_anonymous_commenting', None)
