Changeset 2454 in products
- Timestamp:
- Jun 3, 2010 11:05:05 AM (14 years ago)
- Location:
- quintagroup.plonecaptchas/branches/plone4/quintagroup/plonecaptchas/skins/captchas_sendto_form
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.plonecaptchas/branches/plone4/quintagroup/plonecaptchas/skins/captchas_sendto_form/sendto.cpy
r1874 r2454 23 23 24 24 if not mtool.checkPermission(AllowSendto, context): 25 context.plone_utils.addPortalMessage(_(u'You are not allowed to send this link.'), 'error')26 return state.set(status='failure')27 28 at = getToolByName(context, 'portal_actions')29 show = False30 actions = at.listActionInfos(object=context)31 # Check for visbility of sendto action32 for action in actions:33 if action['id'] == 'sendto' and action['category'] == 'document_actions':34 show = True35 if not show:36 25 context.plone_utils.addPortalMessage(_(u'You are not allowed to send this link.'), 'error') 37 26 return state.set(status='failure') -
quintagroup.plonecaptchas/branches/plone4/quintagroup/plonecaptchas/skins/captchas_sendto_form/sendto_form.cpt
r1874 r2454 3 3 xmlns:metal="http://xml.zope.org/namespaces/metal" 4 4 xmlns:i18n="http://xml.zope.org/namespaces/i18n" 5 metal:use-macro=" here/main_template/macros/master"5 metal:use-macro="context/main_template/macros/master" 6 6 i18n:domain="plone"> 7 7 … … 15 15 <body> 16 16 17 < div metal:fill-slot="main"17 <metal:main fill-slot="main" 18 18 tal:define="errors options/state/getErrors;"> 19 19 … … 21 21 i18n:translate="heading_send_page_to">Send this page to someone</h1> 22 22 23 < pclass="documentDescription"23 <div class="documentDescription" 24 24 i18n:translate="description_send_page_url_to"> 25 25 Fill in the email address of your friend, and we will send an email 26 26 that contains a link to this page. 27 </ p>27 </div> 28 28 29 <div id="content-core"> 30 <form name="sendto_form" 31 class="enableAutoFocus" 32 action="sendto_form" 33 method="post" 34 enctype="multipart/form-data" 35 tal:attributes="action string:${context/@@plone_context_state/object_url}/${template/getId}"> 29 36 30 <form name="sendto_form" 31 class="enableAutoFocus" 32 action="sendto_form" 33 method="post" 34 enctype="multipart/form-data" 35 tal:attributes="action string:$here_url/$template_id"> 37 <fieldset> 36 38 37 <fieldset>39 <legend i18n:translate="legend_address_info">Address info</legend> 38 40 39 <legend i18n:translate="legend_address_info">Address info</legend> 41 <div class="field" 42 tal:define="error errors/send_to_address|nothing;" 43 tal:attributes="class python:test(error, 'field error', 'field')"> 40 44 41 <div class="field" 42 tal:define="error errors/send_to_address|nothing;" 43 tal:attributes="class python:test(error, 'field error', 'field')"> 45 <label for="send_to_address" i18n:translate="label_send_to_mail">Send to</label> 44 46 45 <label for="send_to_address" i18n:translate="label_send_to_mail">Send to</label> 47 <span class="fieldRequired" title="Required" 48 i18n:attributes="title title_required;" 49 i18n:translate="label_required">(Required)</span> 46 50 47 <span class="fieldRequired" title="Required"48 i18n:attributes="title title_required;"49 i18n:translate="label_required">(Required)</span>51 <div class="formHelp" i18n:translate="help_send_to_mail"> 52 The e-mail address to send this link to. 53 </div> 50 54 51 <div class="formHelp" i18n:translate="help_send_to_mail"> 52 The e-mail address to send this link to. 53 </div> 55 <div tal:content="error">Validation error output</div> 54 56 55 <div tal:content="error">Validation error output</div> 57 <input type="text" 58 id="send_to_address" 59 name="send_to_address" 60 size="25" 61 tal:attributes="value request/send_to_address | nothing;" 62 /> 63 </div> 56 64 57 <input type="text" 58 id="send_to_address" 59 name="send_to_address" 60 size="25" 61 tal:attributes="value request/send_to_address | nothing;" 62 /> 63 </div> 65 <div class="field" 66 tal:define="error errors/send_from_address|nothing;" 67 tal:attributes="class python:test(error, 'field error', 'field')"> 64 68 65 <div class="field" 66 tal:define="error errors/send_from_address|nothing;" 67 tal:attributes="class python:test(error, 'field error', 'field')"> 69 <label for="send_from_address" i18n:translate="label_send_from">From</label> 68 70 69 <label for="send_from_address" i18n:translate="label_send_from">From</label> 71 <span class="fieldRequired" title="Required" 72 i18n:attributes="title title_required;" 73 i18n:translate="label_required">(Required)</span> 70 74 71 <span class="fieldRequired" title="Required"72 i18n:attributes="title title_required;"73 i18n:translate="label_required">(Required)</span>75 <div class="formHelp" i18n:translate="help_send_from"> 76 Your email address. 77 </div> 74 78 75 <div class="formHelp" i18n:translate="help_send_from"> 76 Your email address. 77 </div> 79 <div tal:content="error">Validation error output</div> 78 80 79 <div tal:content="error">Validation error output</div> 81 <input type="text" 82 id="send_from_address" 83 name="send_from_address" 84 size="25" 85 tal:define="member context/@@plone_portal_state/member;" 86 tal:attributes="value python: request.get('send_from_address', member.getProperty('email',''));" 87 /> 88 </div> 80 89 81 <input type="text" 82 id="send_from_address" 83 name="send_from_address" 84 size="25" 85 tal:attributes="value python: request.get('send_from_address', member.getProperty('email',''));" 86 /> 87 </div> 90 <div class="field"> 91 <label for="comment" i18n:translate="label_comment">Comment</label> 88 92 89 <div class="field"> 90 <label for="comment" i18n:translate="label_comment">Comment</label> 93 <div class="formHelp" i18n:translate="help_comment_to_link"> 94 A comment about this link. 95 </div> 91 96 92 <div class="formHelp" i18n:translate="help_comment_to_link"> 93 A comment about this link. 94 </div> 97 <textarea cols="80" 98 rows="5" 99 id="comment" 100 name="comment" 101 tal:content="request/comment | nothing" 102 > 103 Comment 104 </textarea> 105 </div> 95 106 96 <textarea cols="80" 97 rows="5" 98 id="comment" 99 name="comment" 100 tal:content="request/comment | nothing" 101 > 102 Comment 103 </textarea> 104 </div> 105 106 <div metal:use-macro="here/captcha_widget/macros/captcha"></div> 107 <div class="formControls"> 108 <input class="context" 109 type="submit" 110 name="form.button.Send" 111 value="Send" 112 i18n:attributes="value label_send;" 113 /> 114 </div> 107 <div metal:use-macro="here/captcha_widget/macros/captcha"></div> 115 108 116 <input type="hidden" name="form.submitted" value="1" /> 109 <div class="formControls"> 110 <input class="context" 111 type="submit" 112 name="form.button.Send" 113 value="Send" 114 i18n:attributes="value label_send;" 115 /> 116 </div> 117 117 118 </fieldset>118 <input type="hidden" name="form.submitted" value="1" /> 119 119 120 </form>120 </fieldset> 121 121 122 </div> 122 </form> 123 </div> 124 125 </metal:main> 123 126 124 127 </body>
Note: See TracChangeset
for help on using the changeset viewer.