Changeset 3397 in products
- Timestamp:
- Mar 29, 2012 3:15:54 PM (12 years ago)
- 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 73 73 self.sitemaps = [i.getObject() for i in \ 74 74 self.tools.catalog()(portal_type='Sitemap')] 75 75 76 76 @property 77 77 def sm_types(self): … … 144 144 return (size, entries) 145 145 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 146 155 def getVerificationFiles(self): 147 156 vfs = [] 148 157 props = getattr(self.tools.properties(), 'googlesitemap_properties') 158 portal = self.pps.portal() 149 159 if props: 150 portal_ids = self.pps.portal().objectIds()160 portal_ids = portal.objectIds() 151 161 props_vfs = list(props.getProperty('verification_filenames', [])) 162 152 163 vfs = [vf for vf in props_vfs if vf in portal_ids] 153 164 if not props_vfs == vfs: 154 165 props._updateProperty('verification_filenames', vfs) 155 return vfs 166 167 return [{'id': x, 'title': portal[x].title} for x in vfs] 156 168 157 169 def uploadVerificationFile(self, request): … … 159 171 portal = self.pps.portal() 160 172 try: 173 comment = request.get("comment") 161 174 vfile = request.get("verification_file") 162 175 vfilename, vftitle = cookId("", "", vfile) 163 portal.manage_addFile(id="", file=vfile )176 portal.manage_addFile(id="", file=vfile, title=comment) 164 177 portal[vfilename].manage_addProperty( 165 178 'CreatedBy', 'quintagroupt.plonegooglesitemaps', 'string') -
quintagroup.plonegooglesitemaps/branches/1.7.1/quintagroup/plonegooglesitemaps/browser/configure.zcml
r3247 r3397 50 50 /> 51 51 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 52 74 </configure> -
quintagroup.plonegooglesitemaps/branches/1.7.1/quintagroup/plonegooglesitemaps/skins/plonegooglesitemaps/prefs_gsm_overview.cpt
r2555 r3397 7 7 8 8 <body> 9 <div metal:fill-slot="prefs_configlet_ main"9 <div metal:fill-slot="prefs_configlet_content" 10 10 tal:define="errors python:request.get('errors', {}); 11 11 portal context/@@plone_portal_state/portal;"> 12 12 13 13 <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 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"> </div> 37 37 </div> 38 <div class="documentContent">38 <div id=content class="documentContent"> 39 39 <h1 i18n:translate="heading_plonegooglesitemaps">Plone Google Sitemaps</h1> 40 40 <a href="" -
quintagroup.plonegooglesitemaps/branches/1.7.1/quintagroup/plonegooglesitemaps/skins/plonegooglesitemaps/prefs_gsm_settings.cpt
r2580 r3397 6 6 i18n:domain="qPloneGoogleSitemaps"> 7 7 <body> 8 <div metal:fill-slot="prefs_configlet_ main"8 <div metal:fill-slot="prefs_configlet_content" 9 9 tal:define="errors python:request.get('errors', {}); 10 10 here_url context/@@plone_context_state/object_url; … … 12 12 13 13 <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"> 16 27 <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 28 tal:attributes="href string:${template/id}"> 29 Settings</a> 30 </li> 31 </ul> 32 <div class="contentActions"> </div> 33 33 </div> 34 <div class="documentContent">34 <div id=content class="documentContent"> 35 35 <h1 i18n:translate="heading_plonegooglesitemaps">Plone Google Sitemaps</h1> 36 36 <a href="" -
quintagroup.plonegooglesitemaps/branches/1.7.1/quintagroup/plonegooglesitemaps/skins/plonegooglesitemaps/prefs_gsm_verification.cpt
r2555 r3397 6 6 i18n:domain="qPloneGoogleSitemaps"> 7 7 <body> 8 <div metal:fill-slot="prefs_configlet_ main"8 <div metal:fill-slot="prefs_configlet_content" 9 9 tal:define="errors python:request.get('errors', {}); 10 10 view here/@@sitemap_settings; … … 14 14 15 15 <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=""> 18 31 <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> 22 35 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 36 </ul> 37 <div class="contentActions"> </div> 39 38 </div> 40 <div class="documentContent">39 <div id="content" class="documentContent"> 41 40 <h1 i18n:translate="heading_plonegooglesitemaps">Plone Google Sitemaps</h1> 42 41 <a href="" … … 49 48 <form action="manage_addFile" method="post" enctype="multipart/form-data" 50 49 tal:define="vfiles view/getVerificationFiles; 50 user_id context/plone_portal_state/member; 51 51 step1 python:test(vfiles, 'discreet', ''); 52 52 step2 python:test(not vfiles, 'discreet', '')" … … 62 62 <p><input name="verification_file" id="verify_filename" type="file"></p> 63 63 </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> 67 68 </li> 68 69 <li class="discreet" … … 75 76 tal:attributes="class step2" 76 77 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> 80 83 </li></ul> 81 84 </li>
Note: See TracChangeset
for help on using the changeset viewer.