Ignore:
Timestamp:
Jun 11, 2010 8:59:25 AM (14 years ago)
Author:
mylan
Message:

#192: Updated configlet verification form

Location:
quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/skins/plonegooglesitemaps
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/skins/plonegooglesitemaps/gsm_create_verify_file.cpy

    r1593 r2518  
    55##bind script=script 
    66##bind subpath=traverse_subpath 
    7 ##parameters=verify_filename 
     7##parameters= 
    88##title=Create file for verification 
    99## 
    1010 
    1111from Products.CMFCore.utils import getToolByName 
    12 from quintagroup.plonegooglesitemaps.utils import BadRequestException 
    1312portal = getToolByName(context, 'portal_url').getPortalObject() 
    14 try: 
    15     portal.manage_addFile(verify_filename,title='Verification File') 
    16     portal[verify_filename].manage_addProperty('CreatedBy','quintagroupt.plonegooglesitemaps','string') 
    17 except BadRequestException: 
    18     pass 
     13sitemap_view = portal.restrictedTraverse("sitemap_settings") 
     14isAdded, res = sitemap_view.uploadVerificationFile(context.REQUEST) 
     15if isAdded: 
     16    state.set(status="success", 
     17              portal_status_message = 'Plone Google Sitemap updated.') 
    1918else: 
    20     props = getToolByName(context,'portal_properties').googlesitemap_properties 
    21     vfiles = list(props.getProperty('verification_filenames',[])) 
    22     vfiles.append(verify_filename) 
    23     props.manage_changeProperties(verification_filenames = vfiles) 
     19    state.set(status="failure", 
     20              portal_status_message = 'Error on file upload: "%s"' % res) 
     21    #context.plone_utils.addPortalMessage(_(u'Please correct the indicated errors.'), 'error') 
    2422 
    25 return state.set(portal_status_message = 'Plone Google Sitemap updated.') 
     23return state 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/skins/plonegooglesitemaps/prefs_gsm_verification.cpt

    r1593 r2518  
    4444                </a> 
    4545 
    46                 <form tal:define="vfiles view/getVerificationFiles; 
     46                <form action="manage_addFile" method="post" enctype="multipart/form-data" 
     47                      tal:define="vfiles view/getVerificationFiles; 
    4748                                  step1 python:test(vfiles, 'discreet', ''); 
    48                                   step2 python:test(not vfiles, 'discreet', '')"> 
     49                                  step2 python:test(not vfiles, 'discreet', '')" 
     50                      tal:attributes="action string:$here_url/$template_id"> 
    4951                    <ol> 
    5052                        <li tal:attributes="class step1"> 
    5153                            Go to <a href="" 
    52                                         tal:attributes="href string: https://www.google.com/webmasters/sitemaps/verify?siteUrl=${portal/absolute_url}&hl=en" 
     54                                        tal:attributes="href string: https://www.google.com/webmasters/verification/verification?siteUrl=${portal/absolute_url}&hl=en" 
    5355                                        tal:omit-tag="step1"> 
    54                         site verification page</a> and login if necessary. 
     56                        site verification page</a> and login if necessary. If <strong>Verification status</strong> is <i>Not Verified</i>, from <strong>Verification method</strong> selection box chose <i>Upload an HTML file</i> and download generated file to you system (you should know where the file is downloaded). 
    5557                        </li> 
    56                         <li tal:attributes="class step1">Provide verification file name: 
    57                             <p><input name="verify_filename" id="verify_filename" type="text"></p> 
     58                        <li tal:attributes="class step1">Select verification file: 
     59                            <p><input name="verification_file" id="verify_filename" type="file"></p> 
    5860                        </li> 
    5961                        <li tal:attributes="class step1"> 
    60                                 <input name="form.button.CreateFile" id="create_file" type="submit" value="Create verification file"/> 
     62                                <input name="form.button.CreateFile" id="create_file" type="submit" value="Upload verification file to the site"/> 
    6163                                <input type="hidden" name="form.submitted" value="1" /> 
    6264                        </li> 
Note: See TracChangeset for help on using the changeset viewer.