Changeset 3397 in products for quintagroup.plonegooglesitemaps


Ignore:
Timestamp:
Mar 29, 2012 3:15:54 PM (12 years ago)
Author:
potar
Message:

Prepared to release new package

Location:
quintagroup.plonegooglesitemaps/branches/1.7.1/quintagroup/plonegooglesitemaps
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/branches/1.7.1/quintagroup/plonegooglesitemaps/browser/configletview.py

    r3163 r3397  
    7373        self.sitemaps = [i.getObject() for i in \ 
    7474                         self.tools.catalog()(portal_type='Sitemap')] 
    75  
     75  
    7676    @property 
    7777    def sm_types(self): 
     
    144144        return (size, entries) 
    145145 
     146    def deleteVerificationFile(self): 
     147        portal = self.pps.portal() 
     148        portal.manage_delObjects([self.request.id,]) 
     149        if 'HTTP_REFERER' in self.request.keys():       
     150            url = self.request.HTTP_REFERER 
     151        else: 
     152            url = self.context + 'prefs_gsm_verification' 
     153        self.request.RESPONSE.redirect(url) 
     154 
    146155    def getVerificationFiles(self): 
    147156        vfs = [] 
    148157        props = getattr(self.tools.properties(), 'googlesitemap_properties') 
     158        portal = self.pps.portal() 
    149159        if props: 
    150             portal_ids = self.pps.portal().objectIds() 
     160            portal_ids = portal.objectIds() 
    151161            props_vfs = list(props.getProperty('verification_filenames', [])) 
     162 
    152163            vfs = [vf for vf in props_vfs if vf in portal_ids] 
    153164            if not props_vfs == vfs: 
    154165                props._updateProperty('verification_filenames', vfs) 
    155         return vfs 
     166 
     167        return [{'id': x, 'title': portal[x].title} for x in vfs] 
    156168 
    157169    def uploadVerificationFile(self, request): 
     
    159171        portal = self.pps.portal() 
    160172        try: 
     173            comment = request.get("comment") 
    161174            vfile = request.get("verification_file") 
    162175            vfilename, vftitle = cookId("", "", vfile) 
    163             portal.manage_addFile(id="", file=vfile) 
     176            portal.manage_addFile(id="", file=vfile, title=comment) 
    164177            portal[vfilename].manage_addProperty( 
    165178                'CreatedBy', 'quintagroupt.plonegooglesitemaps', 'string') 
  • quintagroup.plonegooglesitemaps/branches/1.7.1/quintagroup/plonegooglesitemaps/browser/configure.zcml

    r3247 r3397  
    5050    /> 
    5151 
     52    <browser:page 
     53      for="Products.CMFPlone.interfaces.IPloneSiteRoot" 
     54      name="deleteVerificationFile" 
     55      class=".configletview.ConfigletSettingsView" 
     56      permission="cmf.ManagePortal" 
     57      attribute="deleteVerificationFile" 
     58    /> 
     59 
     60    <browser:resource                                                            
     61      name="trash.gif"                                                           
     62      image="./images/trash.gif"                                                 
     63      layer="quintagroup.plonegooglesitemaps.interfaces.IGoogleSitemapsLayer" 
     64      permission="cmf.ManagePortal" 
     65    />      
     66     
     67    <browser:resource 
     68      name="verify_file.css" 
     69      file="resources/verify_file.css" 
     70      layer="quintagroup.plonegooglesitemaps.interfaces.IGoogleSitemapsLayer" 
     71      permission="cmf.ManagePortal" 
     72    /> 
     73 
    5274</configure> 
  • quintagroup.plonegooglesitemaps/branches/1.7.1/quintagroup/plonegooglesitemaps/skins/plonegooglesitemaps/prefs_gsm_overview.cpt

    r2555 r3397  
    77 
    88<body> 
    9   <div metal:fill-slot="prefs_configlet_main" 
     9  <div metal:fill-slot="prefs_configlet_content" 
    1010       tal:define="errors python:request.get('errors', {}); 
    1111                   portal context/@@plone_portal_state/portal;"> 
    1212 
    1313    <div class="documentEditable"> 
    14         <ul class="contentViews"> 
    15             <li class="selected"> 
    16                 <a href="" 
    17                    tal:attributes="href string:${template/id}" 
    18                    i18n:translate="label_properties">Overview</a> 
    19             </li> 
    20  
    21             <li class=""> 
    22                 <a href="" 
    23                    tal:attributes="href string: prefs_gsm_verification" 
    24                    i18n:translate="label_properties">Verification</a> 
    25             </li> 
    26  
    27             <li class=""> 
    28                <a href="" 
    29                   tal:attributes="href string: prefs_gsm_settings"> 
    30                   Settings</a> 
    31             </li> 
    32  
    33         </ul> 
    34  
    35         <div class="contentActions"> 
    36         &nbsp; 
     14        <div id="edit-bar"> 
     15            <ul class="contentViews" id="content-views"> 
     16                <li class="selected"> 
     17                    <a href="" 
     18                       tal:attributes="href string:${template/id}" 
     19                       i18n:translate="label_properties">Overview</a> 
     20                </li> 
     21     
     22                <li class=""> 
     23                    <a href="" 
     24                       tal:attributes="href string: prefs_gsm_verification" 
     25                       i18n:translate="label_properties">Verification</a> 
     26                </li> 
     27     
     28                <li class=""> 
     29                   <a href="" 
     30                      tal:attributes="href string: prefs_gsm_settings"> 
     31                      Settings</a> 
     32                </li> 
     33     
     34            </ul> 
     35     
     36            <div class="contentActions"> &nbsp; </div> 
    3737        </div> 
    38         <div class="documentContent"> 
     38        <div id=content class="documentContent"> 
    3939            <h1 i18n:translate="heading_plonegooglesitemaps">Plone Google Sitemaps</h1> 
    4040            <a href="" 
  • quintagroup.plonegooglesitemaps/branches/1.7.1/quintagroup/plonegooglesitemaps/skins/plonegooglesitemaps/prefs_gsm_settings.cpt

    r2580 r3397  
    66      i18n:domain="qPloneGoogleSitemaps"> 
    77<body> 
    8     <div metal:fill-slot="prefs_configlet_main" 
     8    <div metal:fill-slot="prefs_configlet_content" 
    99        tal:define="errors python:request.get('errors', {}); 
    1010                    here_url context/@@plone_context_state/object_url; 
     
    1212 
    1313        <div class="documentEditable"> 
    14             <ul class="contentViews"> 
    15                 <li class=""> 
     14            <div id="edit-bar"> 
     15                <ul class="contentViews" id="content-views"> 
     16                    <li class=""> 
     17                        <a href="" 
     18                           tal:attributes="href string: prefs_gsm_overview"> 
     19                           Overview</a> 
     20                    </li> 
     21                    <li class=""> 
     22                        <a href="" 
     23                           tal:attributes="href string:prefs_gsm_verification"> 
     24                           Verification</a> 
     25                    </li> 
     26                    <li class="selected"> 
    1627                    <a href="" 
    17                        tal:attributes="href string: prefs_gsm_overview"> 
    18                        Overview</a> 
    19                 </li> 
    20                 <li class=""> 
    21                     <a href="" 
    22                        tal:attributes="href string:prefs_gsm_verification"> 
    23                        Verification</a> 
    24                 </li> 
    25                 <li class="selected"> 
    26                 <a href="" 
    27                    tal:attributes="href string:${template/id}"> 
    28                    Settings</a> 
    29                 </li> 
    30             </ul> 
    31             <div class="contentActions"> 
    32             &nbsp; 
     28                       tal:attributes="href string:${template/id}"> 
     29                       Settings</a> 
     30                    </li> 
     31                </ul> 
     32                <div class="contentActions"> &nbsp; </div> 
    3333            </div> 
    34             <div class="documentContent"> 
     34            <div id=content class="documentContent"> 
    3535                <h1 i18n:translate="heading_plonegooglesitemaps">Plone Google Sitemaps</h1> 
    3636                <a href="" 
  • quintagroup.plonegooglesitemaps/branches/1.7.1/quintagroup/plonegooglesitemaps/skins/plonegooglesitemaps/prefs_gsm_verification.cpt

    r2555 r3397  
    66      i18n:domain="qPloneGoogleSitemaps">  
    77<body> 
    8     <div metal:fill-slot="prefs_configlet_main" 
     8    <div metal:fill-slot="prefs_configlet_content" 
    99        tal:define="errors python:request.get('errors', {}); 
    1010                    view here/@@sitemap_settings; 
     
    1414 
    1515        <div class="documentEditable"> 
    16             <ul class="contentViews"> 
    17                 <li class=""> 
     16            <div id="edit-bar"> 
     17                <ul class="contentViews" id="content-views"> 
     18                    <li class=""> 
     19                        <a href="" 
     20                        tal:attributes="href string: prefs_gsm_overview" 
     21                        i18n:translate="label_properties">Overview</a> 
     22                    </li> 
     23 
     24                    <li class="selected"> 
     25                        <a href="" 
     26                        tal:attributes="href string:${template/id}" 
     27                        i18n:translate="label_properties">Verification</a> 
     28                    </li> 
     29 
     30                    <li class=""> 
    1831                    <a href="" 
    19                     tal:attributes="href string: prefs_gsm_overview" 
    20                     i18n:translate="label_properties">Overview</a> 
    21                 </li> 
     32                        tal:attributes="href string:prefs_gsm_settings"> 
     33                        Settings</a> 
     34                    </li> 
    2235 
    23                 <li class="selected"> 
    24                     <a href="" 
    25                     tal:attributes="href string:${template/id}" 
    26                     i18n:translate="label_properties">Verification</a> 
    27                 </li> 
    28  
    29                 <li class=""> 
    30                 <a href="" 
    31                     tal:attributes="href string:prefs_gsm_settings"> 
    32                     Settings</a> 
    33                 </li> 
    34  
    35             </ul> 
    36  
    37             <div class="contentActions"> 
    38             &nbsp; 
     36                </ul> 
     37                <div class="contentActions"> &nbsp; </div> 
    3938            </div> 
    40             <div class="documentContent"> 
     39            <div id="content" class="documentContent"> 
    4140                <h1 i18n:translate="heading_plonegooglesitemaps">Plone Google Sitemaps</h1> 
    4241                <a href="" 
     
    4948                <form action="manage_addFile" method="post" enctype="multipart/form-data" 
    5049                      tal:define="vfiles view/getVerificationFiles; 
     50                                  user_id context/plone_portal_state/member; 
    5151                                  step1 python:test(vfiles, 'discreet', ''); 
    5252                                  step2 python:test(not vfiles, 'discreet', '')" 
     
    6262                            <p><input name="verification_file" id="verify_filename" type="file"></p> 
    6363                        </li> 
    64                         <li tal:attributes="class step1"> 
    65                                 <input name="form.button.CreateFile" id="create_file" type="submit" value="Upload verification file to the site"/> 
    66                                 <input type="hidden" name="form.submitted" value="1" /> 
     64                        <li tal:attributes="class step1">Comment: 
     65                                <p><input type="text" value="" tal:attributes="value user_id" name='comment'/> 
     66                                   <input name="form.button.CreateFile" id="create_file" type="submit" value="Upload verification file to the site"/> 
     67                                   <input type="hidden" name="form.submitted" value="1" /></p> 
    6768                        </li> 
    6869                        <li class="discreet" 
     
    7576                            tal:attributes="class step2" 
    7677                            tal:condition="vfiles"> 
    77                             <strong>Existent verification files:</strong> 
    78                             <ul><li tal:repeat="vf vfiles" 
    79                                     tal:content="vf">verification file id 
     78                            <strong>Existing verification files:</strong> 
     79                            <ul><li tal:repeat="vf vfiles"> 
     80                                    <a tal:attributes="href string: ${vf/id}" tal:content="vf/id"></a> 
     81                                    <span tal:replace="string: (${vf/title})">comment to verification file</span> 
     82                                    <a tal:attributes="href string: ${context/absolute_url}/@@deleteVerificationFile?id=${vf/id}; class string:delete">Delete</a> 
    8083                            </li></ul> 
    8184                        </li> 
Note: See TracChangeset for help on using the changeset viewer.