Changeset 2454 in products


Ignore:
Timestamp:
Jun 3, 2010 11:05:05 AM (14 years ago)
Author:
mylan
Message:

#194: Fixed sendto form for plone-4

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  
    2323 
    2424if 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 = False 
    30 actions = at.listActionInfos(object=context) 
    31 # Check for visbility of sendto action 
    32 for action in actions: 
    33     if action['id'] == 'sendto' and action['category'] == 'document_actions': 
    34         show = True 
    35 if not show: 
    3625    context.plone_utils.addPortalMessage(_(u'You are not allowed to send this link.'), 'error') 
    3726    return state.set(status='failure') 
  • quintagroup.plonecaptchas/branches/plone4/quintagroup/plonecaptchas/skins/captchas_sendto_form/sendto_form.cpt

    r1874 r2454  
    33      xmlns:metal="http://xml.zope.org/namespaces/metal" 
    44      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" 
    66      i18n:domain="plone"> 
    77 
     
    1515  <body> 
    1616 
    17     <div metal:fill-slot="main" 
     17    <metal:main fill-slot="main" 
    1818         tal:define="errors options/state/getErrors;"> 
    1919 
     
    2121          i18n:translate="heading_send_page_to">Send this page to someone</h1> 
    2222 
    23       <p class="documentDescription" 
     23      <div class="documentDescription" 
    2424         i18n:translate="description_send_page_url_to"> 
    2525        Fill in the email address of your friend, and we will send an email 
    2626        that contains a link to this page. 
    27       </p> 
     27      </div> 
    2828 
     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}"> 
    2936 
    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> 
    3638 
    37         <fieldset> 
     39              <legend i18n:translate="legend_address_info">Address info</legend> 
    3840 
    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')"> 
    4044 
    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> 
    4446 
    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> 
    4650 
    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> 
    5054 
    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> 
    5456 
    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> 
    5664 
    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')"> 
    6468 
    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> 
    6870 
    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> 
    7074 
    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> 
    7478 
    75                   <div class="formHelp" i18n:translate="help_send_from"> 
    76                     Your email address. 
    77                   </div> 
     79                      <div tal:content="error">Validation error output</div> 
    7880 
    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> 
    8089 
    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> 
    8892 
    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> 
    9196 
    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> 
    95106 
    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> 
    115108 
    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> 
    117117 
    118         </fieldset> 
     118              <input type="hidden" name="form.submitted" value="1" /> 
    119119 
    120       </form> 
     120            </fieldset> 
    121121 
    122     </div> 
     122          </form> 
     123      </div> 
     124       
     125    </metal:main> 
    123126 
    124127  </body> 
Note: See TracChangeset for help on using the changeset viewer.