Changeset 556
- Timestamp:
- 09/29/06 12:02:22
- Files:
-
- SimpleBlog/trunk/Blog.py (modified) (6 diffs)
- SimpleBlog/trunk/BlogEntry.py (modified) (5 diffs)
- SimpleBlog/trunk/BloggerAPI.py (copied) (copied from SimpleBlog/branches/plone-2.1-Blogging-APIs/BloggerAPI.py)
- SimpleBlog/trunk/Extensions/Install.py (modified) (5 diffs)
- SimpleBlog/trunk/Extensions/utils.py (modified) (1 diff)
- SimpleBlog/trunk/MetaWeblogAPI.py (copied) (copied from SimpleBlog/branches/plone-2.1-Blogging-APIs/MetaWeblogAPI.py)
- SimpleBlog/trunk/MovableTypeAPI.py (copied) (copied from SimpleBlog/branches/plone-2.1-Blogging-APIs/MovableTypeAPI.py)
- SimpleBlog/trunk/SimpleBlogTool.py (modified) (2 diffs)
- SimpleBlog/trunk/TrackbackWorkflow.py (modified) (1 diff)
- SimpleBlog/trunk/__init__.py (modified) (2 diffs)
- SimpleBlog/trunk/config.py (modified) (1 diff)
- SimpleBlog/trunk/skins/SimpleBlog/SimpleBlog_macros.pt (modified) (13 diffs)
- SimpleBlog/trunk/skins/SimpleBlog/blogentry_view.pt (modified) (2 diffs)
- SimpleBlog/trunk/skins/SimpleBlog/delicious.gif (copied) (copied from SimpleBlog/branches/plone-2.1-Blogging-APIs/skins/SimpleBlog/delicious.gif)
- SimpleBlog/trunk/skins/SimpleBlog/digg.gif (copied) (copied from SimpleBlog/branches/plone-2.1-Blogging-APIs/skins/SimpleBlog/digg.gif)
- SimpleBlog/trunk/skins/SimpleBlog/google.gif (copied) (copied from SimpleBlog/branches/plone-2.1-Blogging-APIs/skins/SimpleBlog/google.gif)
- SimpleBlog/trunk/skins/SimpleBlog/portlet_simpleblog.pt (modified) (2 diffs)
- SimpleBlog/trunk/skins/SimpleBlog/spurl.gif (copied) (copied from SimpleBlog/branches/plone-2.1-Blogging-APIs/skins/SimpleBlog/spurl.gif)
- SimpleBlog/trunk/skins/SimpleBlog/yahoo.gif (copied) (copied from SimpleBlog/branches/plone-2.1-Blogging-APIs/skins/SimpleBlog/yahoo.gif)
- SimpleBlog/trunk/util.py (modified) (1 diff)
- SimpleBlog/trunk/version.txt (modified) (1 diff)
- SimpleBlog/trunk/xmlrpcMonkeyPatch.py (copied) (copied from SimpleBlog/branches/plone-2.1-Blogging-APIs/xmlrpcMonkeyPatch.py)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
SimpleBlog/trunk/Blog.py
r555 r556 6 6 import Permissions 7 7 from Products.CMFCore.utils import getToolByName 8 9 import MetaWeblogAPI 10 import BloggerAPI 11 import MovableTypeAPI 12 8 13 9 14 schema = BaseFolderSchema + Schema(( … … 84 89 description_msgid="help_allow_trackback",), 85 90 ), 91 # used to be new trackbaks notification email address 86 92 StringField('adminEmail', 87 93 accessor = 'getAdminEmail', … … 93 99 description_msgid="help_adminEmail", 94 100 i18n_domain="SimpleBlog", 95 condition="python:0", 101 condition="python:0", # this line have to be removed in order to be visible/editable 96 102 description="Enter administrator's email for receaving notification about blog's activity"), 97 ) 103 ), 104 BooleanField('allowDelicious', 105 default = 1, 106 accessor = 'isDeliciousEnabled', 107 schemata = 'interface', 108 widget=BooleanWidget(label="Turn Delicious bookmarklet", 109 label_msgid="label_allow_delicious", 110 description_msgid="help_allow_delicious"), 111 ), 112 BooleanField('allowDigg', 113 default = 1, 114 accessor = 'isDiggEnabled', 115 schemata = 'interface', 116 widget=BooleanWidget(label="Turn Digg bookmarklet", 117 label_msgid="label_allow_digg", 118 description_msgid="help_allow_digg"), 119 ), 120 BooleanField('allowYahoo', 121 default = 1, 122 accessor = 'isYahooEnabled', 123 schemata = 'interface', 124 widget=BooleanWidget(label="Turn Yahoo bookmarklet", 125 label_msgid="label_allow_yahoo", 126 description_msgid="help_allow_yahoo"), 127 ), 128 BooleanField('allowGoogle', 129 default = 1, 130 accessor = 'isGoogleEnabled', 131 schemata = 'interface', 132 widget=BooleanWidget(label="Turn Google bookmarklet", 133 label_msgid="label_allow_google", 134 description_msgid="help_allow_google"), 135 ), 136 BooleanField('allowSpurl', 137 default = 1, 138 accessor = 'isSpurlEnabled', 139 schemata = 'interface', 140 widget=BooleanWidget(label="Turn Spurl bookmarklet", 141 label_msgid="label_allow_spurl", 142 description_msgid="help_allow_spurl"), 143 ), 98 144 #BooleanField('allowComments', 99 145 # default = 1, … … 122 168 global_allow=1 123 169 schema=schema 170 171 blogger = None 172 metaWeblog = None 124 173 125 174 content_icon='simpleblog_icon.gif' … … 140 189 'visible':0}) 141 190 191 def initializeArchetype(self, **kwargs): 192 BaseFolder.initializeArchetype(self, **kwargs) 193 RPCAuth = self.simpleblog_tool.findRPCAuth(self) 194 195 # Setup the MetaWeblog API 196 self.metaWeblog = MetaWeblogAPI.MetaWeblogAPI().__of__(self) 197 self.metaWeblog.setupRPCAuth(RPCAuth) 198 199 # Setup the Blogger API 200 self.blogger = BloggerAPI.BloggerAPI().__of__(self) 201 self.blogger.setupRPCAuth(RPCAuth) 202 203 # Setup the MovableTypeAPI API 204 self.mt = MovableTypeAPI.MovableTypeAPI().__of__(self) 205 self.mt.setupRPCAuth(RPCAuth) 206 142 207 def manage_afterAdd(self, item, container): 143 208 BaseFolder.manage_afterAdd(self, item, container) … … 170 235 return val 171 236 237 def listCategories(self): 238 cats=self.getCategories() 239 240 # add the global categories 241 for c in self.simpleblog_tool.getGlobalCategories(): 242 if not c in cats: 243 cats.append(c) 244 cats = list(cats) 245 cats.sort() 246 return tuple(cats) 247 172 248 registerType(Blog) 173 249 SimpleBlog/trunk/BlogEntry.py
r555 r556 16 16 import sys 17 17 from util import * 18 from config import DIGG_TOPICS 18 19 19 20 schema = BaseFolderSchema + Schema(( … … 97 98 i18n_domain = "SimpleBlog", 98 99 description = 'Controls if the Entry (when published) shown as the first Entry. If not checked, the effective date is used.')), 99 100 100 LinesField('sendTrackBackURLs', 101 101 languageIndependent = True, … … 107 107 i18n_domain = "plone")), 108 108 109 109 BooleanField('enableTopAdsence', 110 widget = BooleanWidget(format = 'select', 111 label_msgid = "label_enable_top_adsence", 112 description_msgid = "help_enable_top_adsence", 113 i18n_domain = "SimpleBlog", 114 label = 'Enable top Adsence block', 115 description = None)), 116 StringField('topAdsence', 117 vocabulary = 'listAdesnceTemplates', 118 widget = SelectionWidget(format = 'select', 119 label_msgid = "label_top_adsence", 120 description_msgid = "help_top_adsence", 121 i18n_domain = "SimpleBlog", 122 label = 'Top Adsence', 123 description = None)), 124 BooleanField('enableBottomAdsence', 125 widget = BooleanWidget(format = 'select', 126 label_msgid = "label_enable_bottom_adsence", 127 description_msgid = "help_enable_bottom_adsence", 128 i18n_domain = "SimpleBlog", 129 label = 'Enable bottom Adsence block', 130 description = None)), 131 StringField('bottomAdsence', 132 vocabulary = 'listAdesnceTemplates', 133 widget = SelectionWidget(format = 'select', 134 label_msgid = "label_bottom_adsence", 135 description_msgid = "help_bottom_adsence", 136 i18n_domain = "SimpleBlog", 137 label = 'Bottom Adsence', 138 description = None)), 139 StringField('diggTopic', 140 default='offbeat_news', 141 vocabulary=DIGG_TOPICS, 142 widget=SelectionWidget(label='Digg topic', 143 label_msgid="label_digg_topic", 144 description_msgid="help_digg_topic", 145 i18n_domain="SimpleBlog", 146 description='Choose the digg topic.')), 110 147 )) 111 148 … … 251 288 parent = self.aq_parent 252 289 portal = self.portal_url.getPortalObject() 253 254 290 while parent != portal: 255 291 if parent.portal_type == 'Blog': … … 259 295 return tuple(tags) 260 296 297 def listAdesnceTemplates(self): 298 """ return list of available adsence blocks """ 299 pp = getToolByName(self, 'portal_properties') 300 templates = () 301 try: 302 templates = pp.simpleblog_properties.getProperty('adsence_templates',()) 303 except: 304 pass 305 return templates 306 261 307 registerType(BlogEntry) SimpleBlog/trunk/Extensions/Install.py
r555 r556 6 6 7 7 from Products.SimpleBlog.config import * 8 9 from Products.SimpleBlog import MetaWeblogAPI 10 from Products.SimpleBlog import BloggerAPI 11 from Products.SimpleBlog import MovableTypeAPI 8 12 9 13 portlets=['here/portlet_simpleblog/macros/portletBlogFull_local', … … 37 41 site_props._updateProperty('use_folder_tabs', tuple(use_folder_tabs) + ('Blog','BlogFolder','BlogEntry')) 38 42 43 if not portal.hasProperty('trackback_notification_email'): 44 portal.manage_addProperty('trackback_notification_email', '', 'string') 45 39 46 # check for property use_folder_contents. This property seems not to be always there: 40 47 if not site_props.hasProperty('use_folder_contents'): 41 48 site_props.manage_addProperty('use_folder_contents', '', 'lines') 42 49 43 50 use_folder_contents = site_props.getProperty('use_folder_contents') 44 51 if not 'Blog' in use_folder_contents: 45 52 site_props._updateProperty('use_folder_contents', tuple(use_folder_contents) + ('Blog','BlogFolder', 'BlogEntry')) 46 53 47 54 # discussion enabled by default for BlogEntries 48 55 getToolByName(self, 'portal_types').BlogEntry.allow_discussion=1 … … 70 77 71 78 add_workflow(self, 'simpleblog_workflow', 'simpleblog_workflow (Workflow for Blog Entries)', ('BlogEntry',), out) 72 wf_tool.setChainForPortalTypes(('Blog','BlogFolder'), 'folder_workflow') 79 wf_tool.setChainForPortalTypes(('Blog','BlogFolder'), 'folder_workflow') 73 80 74 81 from Products.SimpleBlog import TrackbackWorkflow … … 77 84 add_workflow(self, 'trackback_workflow', 'trackback_workflow (TrackBack Workflow)', ('TrackBack',), out) 78 85 wf_tool.setChainForPortalTypes( ('TrackBack'), 'trackback_workflow') 79 86 87 # Create an RPCAuth if there is not one already 88 installRPCAuth(self) 89 RPCAuth = self.simpleblog_tool.findRPCAuth(self) 90 91 # add the blogger object to the portal's root 92 # Setup the MetaWeblog API 93 portal.metaWeblog = MetaWeblogAPI.MetaWeblogAPI().__of__(self) 94 portal.metaWeblog.setupRPCAuth(RPCAuth) 95 96 # Setup the Blogger API 97 portal.blogger = BloggerAPI.BloggerAPI().__of__(self) 98 portal.blogger.setupRPCAuth(RPCAuth) 99 100 # Setup the MovableTypeAPI API 101 portal.mt = MovableTypeAPI.MovableTypeAPI().__of__(self) 102 portal.mt.setupRPCAuth(RPCAuth) 103 80 104 print >> out, "Successfully installed %s." % PROJECTNAME 81 105 return out.getvalue() … … 93 117 wf_tool.setChainForPortalTypes(types, wf_id) 94 118 out.write('Added workflow "%s"\n'%wf_id) 119 120 def installRPCAuth(self): 121 if not hasattr(self, 'RPCAuth'): 122 try: 123 self.manage_addProduct['RPCAuth'].manage_addRPCAuth('RPCAuth') 124 except: 125 raise "An RPCAuth instance could not be created. Please make sure RPCAuth is installed correctly." 95 126 96 127 SimpleBlog/trunk/Extensions/utils.py
r555 r556 29 29 pass 30 30 31 32 from Products.SimpleBlog import MetaWeblogAPI 33 from Products.SimpleBlog import BloggerAPI 34 from Products.SimpleBlog import MovableTypeAPI 35 36 def migrateToAPIs(self): 37 """ migrate existing SimpleBlog instance to support BloggingAPIs """ 38 RPCAuth = self.simpleblog_tool.findRPCAuth(self) 39 # Setup the MetaWeblog API 40 self.metaWeblog = MetaWeblogAPI.MetaWeblogAPI().__of__(self) 41 self.metaWeblog.setupRPCAuth(RPCAuth) 42 # Setup the Blogger API 43 self.blogger = BloggerAPI.BloggerAPI().__of__(self) 44 self.blogger.setupRPCAuth(RPCAuth) 45 # Setup the MovableTypeAPI API 46 self.mt = MovableTypeAPI.MovableTypeAPI().__of__(self) 47 self.mt.setupRPCAuth(RPCAuth) SimpleBlog/trunk/SimpleBlogTool.py
r555 r556 6 6 from Products.CMFCore import CMFCorePermissions 7 7 import zLOG,os 8 8 from Products.CMFCore.utils import getToolByName 9 import re 9 10 import calendar 10 11 calendar.setfirstweekday(6) #start day Mon(0)-Sun(6) … … 32 33 self.manage_addProperty('showIcons', 1,'boolean') 33 34 35 security.declarePublic('getByUID') 36 def getByUID(self, uid): 37 "Shortcut method for the [Blogger,MetaWeblog]API code" 38 39 uid_catalog = getToolByName(self, 'uid_catalog') 40 lazy_cat = uid_catalog(UID=uid) 41 o = lazy_cat[0].getObject() 42 return o 43 44 security.declarePublic('findRPCAuth') 45 def findRPCAuth(self, parent): 46 while hasattr(parent,'aq_parent'): 47 RPCAuths = parent.objectValues('RPC Auth') 48 for RPCAuth in RPCAuths: 49 return RPCAuth 50 parent = parent.aq_parent 51 return None 52 53 security.declarePublic('idFromTitle') 54 def idFromTitle(self, title): 55 id = re.sub('[^A-Za-z0-9_]', '', re.sub(' ', '_', title)).lower() 56 return id 34 57 35 58 def _getState(self): SimpleBlog/trunk/TrackbackWorkflow.py
r555 r556 117 117 tdef = wf.transitions['retract'] 118 118 tdef.setProperties(title="""Member retracts published item""", 119 new_state_id=""" draft""",119 new_state_id="""pending""", 120 120 trigger_type=1, 121 121 script_name="""""", SimpleBlog/trunk/__init__.py
r555 r556 10 10 from Globals import InitializeClass 11 11 12 import xmlrpcMonkeyPatch 12 13 13 14 registerDirectory(SKINS_DIR, GLOBALS) … … 18 19 from AccessControl import ModuleSecurityInfo, allow_module 19 20 ModuleSecurityInfo('Products.SimpleBlog.util').declarePublic('addTrackBack') 21 ModuleSecurityInfo('Products.SimpleBlog.util').declarePublic('encodeURLData') 20 22 21 23 #allow_module('Products.SimpleBlog.Extensions.utils') SimpleBlog/trunk/config.py
r555 r556 11 11 ('descriptionOnly', 'Description only', 'display_description_only'), 12 12 ('titleOnly', 'Title only', 'display_title_only') )) 13 14 DIGG_TOPICS = DisplayList(( \ 15 ('apple', 'Technology:Apple') \ 16 ,('design', 'Technology:Design') \ 17 ,('gadgets', 'Technology:Gadgets') \ 18 ,('hardware', 'Technology:Hardware') \ 19 ,('tech_news', 'Technology:Industry News') \ 20 ,('linux_unix', 'Technology:Linux/Unix') \ 21 ,('mods', 'Technology:Mods') \ 22 ,('programming', 'Technology:Programming') \ 23 ,('security', 'Technology:Security') \ 24 ,('software', 'Technology:Software') \ 25 ,('tech_deals', 'Technology:Tech Deals') \ 26 ,('space', 'Science:Space') \ 27 ,('environment', 'Science:Environment') \ 28 ,('health', 'Science:Health') \ 29 ,('general_sciences', 'Science:General Sciences') \ 30 ,('business_finance', 'World & Business:Business Finance') \ 31 ,('politics', 'World & Business:Political News') \ 32 ,('political_opinion', 'World & Business:Political Opinion') \ 33 ,('world_news', 'World & Business:World News') \ 34 ,('offbeat_news', 'World & Business:Offbeat News') \ 35 ,('baseball', 'Sports:Baseball') \ 36 ,('basketball', 'Sports:Basketball') \ 37 ,('extreme_sports', 'Sports:Extreme Sports') \ 38 ,('football', 'Sports:Football - US/Canada') \ 39 ,('golf', 'Sports:Golf') \ 40 ,('hockey', 'Sports:Hockey') \ 41 ,('motorsport', 'Sports:Motorsport') \ 42 ,('soccer', 'Sports:Soccer') \ 43 ,('tennis', 'Sports:Tennis') \ 44 ,('other_sports', 'Sports:Other Sports') \ 45 ,('videos_animation', 'Videos:Animation') \ 46 ,('videos_comedy', 'Videos:Comedy') \ 47 ,('videos_educational', 'Videos:Educational') \ 48 ,('videos_gaming', 'Videos:Gaming') \ 49 ,('videos_music', 'Videos:Music') \ 50 ,('videos_people', 'Videos:People') \ 51 ,('videos_sports', 'Videos:Sports') \ 52 ,('celebrity', 'Entertainment:Celebrity') \ 53 ,('movies', 'Entertainment:Movies') \ 54 ,('music', 'Entertainment:Music') \ 55 ,('television', 'Entertainment:Television') \ 56 ,('gaming_news', 'Gaming:Gaming News') \ 57 ,('playable_web_games', 'Gaming:Playable Web Games') \ 58 )).sortedByValue() SimpleBlog/trunk/skins/SimpleBlog/SimpleBlog_macros.pt
r555 r556 4 4 <body> 5 5 6 <div metal:define-macro="blogGlobals" 7 tal:define="global fp python:here.simpleblog_tool.getFrontPage(here); 8 global isDeliciousEnaled fp/isDeliciousEnabled; 9 global isDiggEnabled fp/isDiggEnabled; 10 global isYahooEnabled fp/isYahooEnabled; 11 global isGoogleEnabled fp/isGoogleEnabled; 12 global isSpurlEnabled fp/isSpurlEnabled; 13 global isTagsEnabled fp/isTagsEnabled; 14 global isAllowTrackback fp/getAllowTrackback" 15 tal:omit-tag=""> 16 </div> 17 6 18 <div metal:define-macro="full" tal:define="showReadMore python:0" class="simpleBlogEntry"> 19 <div metal:use-macro="obj/SimpleBlog_macros/macros/blogGlobals"/> 7 20 <div tal:define="size headerSize | python:1;title obj/title_or_id; 8 showIcons obj/simpleblog_tool/getShowIcons"21 showIcons fp/simpleblog_tool/getShowIcons" 9 22 class="simpleBlogTitle"> 10 23 <tal:x replace='structure string:<h${size} class="noMargin">'/> … … 25 38 26 39 <div metal:define-macro="descriptionOnly" tal:define="showReadMore python:1" class="simpleBlogEntry"> 40 <div metal:use-macro="obj/SimpleBlog_macros/macros/blogGlobals"/> 27 41 <div tal:define="size headerSize | python:1;title obj/title_or_id; 28 showIcons obj/simpleblog_tool/getShowIcons"42 showIcons fp/simpleblog_tool/getShowIcons" 29 43 class="simpleBlogTitle"> 30 44 <tal:x replace='structure string:<h${size} class="noMargin">'/> … … 44 58 45 59 <div metal:define-macro="titleOnly" tal:define="showReadMore python:1" class="simpleBlogTitle"> 60 <div metal:use-macro="obj/SimpleBlog_macros/macros/blogGlobals"/> 46 61 <tal:block tal:define="size headerSize | python:1;title obj/title_or_id; 47 showIcons obj/simpleblog_tool/getShowIcons">62 showIcons fp/simpleblog_tool/getShowIcons"> 48 63 <tal:x replace='structure string:<h${size} class="noMargin">'/> 49 64 <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;"> … … 58 73 </div> 59 74 60 <div metal:define-macro="ByLine" class="BlogByLine"> 75 <div metal:define-macro="ByLine" class="BlogByLine" 76 tal:define="fp nocall:fp | python:here.simpleblog_tool.getFrontPage(here);"> 61 77 <span i18n:translate="blog_by_line"> 62 78 Submitted by … … 71 87 <strong><a href="#" 72 88 tal:define="quotedCat python:pss.url_quote(cat)" 73 tal:attributes="href string:${ here/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}"89 tal:attributes="href string:${fp/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}" 74 90 title="category"><span tal:omit-tag="" tal:content="cat"/></a></strong> 75 91 </tal:categories> … … 79 95 80 96 <div metal:define-macro="technoratiTags" 81 tal:define="cats python:obj.EntryTag();" 82 tal:condition="python:here.isTagsEnabled() and cats" 97 tal:define="cats python:obj.EntryTag(); 98 isTagsEnabled isTagsEnabled | here/isTagsEnabled" 99 tal:condition="python:isTagsEnabled and cats" 83 100 tal:omit-tag=""> 84 101 _____<br/> … … 97 114 <tal:x define="allowed python:obj.portal_discussion.isDiscussionAllowedFor(obj); 98 115 ccount python:allowed and obj.portal_discussion.getDiscussionFor(obj).replyCount(obj); 99 tballowed python:here.getAllowTrackback(); 100 tbcount python:len(obj.getTrackbacks())"> 116 tballowed isAllowTrackback | here/getAllowTrackback; 117 tbcount python:len(obj.getTrackbacks()); 118 fp nocall:fp | python:here.simpleblog_tool.getFrontPage(here)"> 101 119 <span i18n:translate="blog_by_line"> 102 120 <span tal:define="edate python:obj.simpleblog_tool.getEntryDate(obj)" … … 111 129 <strong><a href="#" 112 130 tal:define="quotedCat python:pss.url_quote(cat)" 113 tal:attributes="href string:${ here/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}"131 tal:attributes="href string:${fp/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}" 114 132 title="category"><span tal:omit-tag="" tal:content="cat"/></a></strong> 115 133 </tal:categories> … … 128 146 <div tal:condition="tballowed"> trackback URL: 129 147 <tal:x replace="string:${obj/absolute_url}/sbtrackback"/> 148 </div> 149 <div tal:define="entryURL obj/absolute_url; 150 entryTitle obj/Title; 151 entryDescription obj/Description; 152 entryDiggTopic obj/getDiggTopic; 153 encodeURLData python:modules['Products.SimpleBlog.util'].encodeURLData;" 154 tal:omit-tag=""> 155 <span tal:condition="isDeliciousEnaled | obj/isDeliciousEnabled"> 156 <a href="" 157 title="" 158 tal:define="url_data python:encodeURLData({'url':entryURL,'title':entryTitle});" 159 tal:attributes="href string:http://del.icio.us/post?${url_data}; 160 title string:del.icio.us: ${entryTitle}"> 161 <img src="" 162 alt="del.icio.us" 163 tal:attributes="src string:$portal_url/delicious.gif;" /></a> 164 </span> <span tal:condition="isDiggEnabled | obj/isDiggEnabled"> 165 <a href="" 166 title="" 167 tal:define="url_data python:encodeURLData({'phase':'2','url':entryURL,'title':entryTitle,'bodytext':entryDescription,'topic':entryDiggTopic});" 168 tal:attributes="href string:http://digg.com/submit?${url_data}; 169 title string:Digg: ${entryTitle}"> 170 <img src="" 171 alt="Digg" 172 tal:attributes="src string:$portal_url/digg.gif;" /></a> 173 </span> <span tal:condition="isYahooEnabled | obj/isYahooEnabled"> 174 <a href="" 175 title="" 176 tal:define="url_data python:encodeURLData({'u':entryURL,'t':entryTitle});" 177 tal:attributes="href string:http://myweb2.search.yahoo.com/myresults/bookmarklet?${url_data}; 178 title string:Yahoo: ${entryTitle}"> 179 <img src="" 180 alt="Yahoo" 181 tal:attributes="src string:$portal_url/yahoo.gif;" /></a> 182 </span> <span tal:condition="isGoogleEnabled | obj/isGoogleEnabled"> 183 <a href="" 184 title="" 185 tal:define="url_data python:encodeURLData({'op':'edit','output':'popup','bkmk':entryURL,'title':entryTitle});" 186 tal:attributes="href string:http://www.google.com/bookmarks/mark?${url_data}; 187 title string:Google: ${entryTitle}"> 188 <img src="" 189 alt="Google" 190 tal:attributes="src string:$portal_url/google.gif;" /></a> 191 </span> <span tal:condition="isSpurlEnabled | obj/isSpurlEnabled"> 192 <a href="" 193 title="" 194 tal:define="url_data python:encodeURLData({'url':entryURL,'title':entryTitle});" 195 tal:attributes="href string:http://www.spurl.net/spurl.php?${url_data}; 196 title string:Spurl: ${entryTitle}"> 197 <img src="" 198 alt="Spurl" 199 tal:attributes="src string:$portal_url/spurl.gif;" /></a> 200 </span> 130 201 </div> 131 202 … … 195 266 196 267 <!-- macro used by the portlets to compile a list of available categories --> 197 <div metal:define-macro="portletCategories" tal:define="cats python:here.simpleblog_tool.getAvailableCategories(here)" tal:omit-tag=""> 268 <div metal:define-macro="portletCategories" 269 tal:define="cats python:here.simpleblog_tool.getAvailableCategories(here)" 270 tal:omit-tag=""> 198 271 <tal:toggle tal:define="global toggle python:toggle or 0"/> 272 <dd tal:attributes="class python:test(toggle, 'portletItem even', 'portletItem odd')"> 273 <strong i18n:translate="blog_categories">Categories:</strong> 274 <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/> 275 </dd> 199 276 <tal:cats tal:repeat="cat python:here.simpleblog_tool.getSortedKeys(cats)"> 200 <div tal:define="oddrow repeat/cat/odd" tal:condition="repeat/cat/start" tal:attributes="class python:test(toggle, 'portletContent content odd','portletContent content even')"> 201 <strong i18n:translate="blog_categories">Categories:</strong> 202 </div> 203 <div tal:define="oddrow repeat/cat/odd; 204 pss modules/Products.PythonScripts.standard; 205 quotedCat python:pss.url_quote(cat)" 206 tal:attributes="class python:test(toggle, 'portletContent content even','portletContent content odd')"> 207 <a tal:condition="python:cats[cat]>0" href="#" 208 tal:attributes="href string:${here/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}; 209 title cat" 210 title="category"><span tal:content="cat"/></a> 211 <span tal:condition="python:cats[cat]==0" tal:content="cat"/> 212 (<span tal:content="python:cats[cat]"/>) 213 </div> 214 <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/> 277 <dd tal:define="pss modules/Products.PythonScripts.standard; 278 fp nocall:fp | python:here.simpleblog_tool.getFrontPage(here); 279 quotedCat python:pss.url_quote(cat); 280 category python:'%s (%s)' %(cat,cats[cat])" 281 tal:condition="python:cats[cat]>0" 282 tal:attributes="class python:test(toggle, 'portletItem even', 'portletItem odd')"> 283 <a href="#" 284 tal:attributes="href string:${fp/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}; 285 title cat"><span tal:content="category"/></a> 286 <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/> 287 </dd> 215 288 </tal:cats> 216 289 </div> 217 290 218 291 <!-- macro used by the portlets to compile a list of recent additions --> 219 <div metal:define-macro="portletRecent" tal:define="recent python:here.simpleblog_tool.searchForEntries(here)"> 220 <tal:toggle tal:define="global toggle python:0"/> 292 <div metal:define-macro="portletRecent" 293 tal:define="recent python:here.simpleblog_tool.searchForEntries(here)" 294 tal:omit-tag=""> 295 <tal:toggle tal:define="global toggle python:toggle or 0"/> 296 <tal:block tal:condition="recent"> 297 <dd tal:attributes="class python:test(toggle, 'portletItem even', 'portletItem odd')"> 298 <strong i18n:translate="recent_additions">Recent entries:</strong> 299 <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/> 300 </dd> 221 301 <tal:entries tal:repeat="entry recent"> 222 <div tal:define="oddrow repeat/entry/odd" 223 tal:condition="repeat/entry/start" 224 tal:attributes="class python:test(toggle, 'portletContent content odd','portletContent content even')"> 225 226 227 <tal:frontpage tal:define="fp python:here.simpleblog_tool.getFrontPage(here)"> 228 <a tal:condition="python:fp!=None" href="#" tal:attributes="href fp/absolute_url;title fp/title_or_id" title=""><strong><span tal:replace="fp/title_or_id"/>:</strong></a> 229 <strong tal:condition="python:fp==None" i18n:translate="recent_additions">Recent additions:</strong> 230 </tal:frontpage> 231 </div> 232 <div tal:define="oddrow repeat/entry/odd" 233 tal:attributes="class python:test(toggle, 'portletContent content even','portletContent content odd')"> 302 <dd tal:attributes="class python:test(toggle, 'portletItem even', 'portletItem odd')"> 234 303 <a href="#" 235 304 tal:attributes="href entry/getURL;" … … 238 307 <span tal:content="python:entry.Title or entry.getId"/> 239 308 </a> 240 </div> 241 <div tal:define="oddrow repeat/entry/odd" 242 tal:condition="repeat/entry/end" 243 tal:attributes="class python:test(toggle, 'portletMore portletContent content odd','portletMore portletContent content even')"> 244 <a href="#" tal:attributes="href string:${here/absolute_url}/SimpleBlogFullSearch" 245 title="more..." 246 i18n:attributes="title box_morelink" 247 i18n:translate="box_morelink" 248 i18n:domain="plone">More...</a> 249 </div> 309 <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/> 310 </dd> 311 </tal:entries> 312 <dd tal:attributes="class python:test(toggle, 'portletItem even', 'portletItem odd')" 313 style="text-align:right;"> 314 <a title="More..." 315 tal:attributes="href string:${here/absolute_url}/SimpleBlogFullSearch" 316 i18n:attributes="title box_morelink" 317 i18n:translate="box_morelink" 318 i18n:domain="plone">More...</a> 319 <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/> 320 </dd> 321 </tal:block> 322 <dd tal:condition="not: recent" 323 tal:attributes="class python:test(toggle, 'portletItem even', 'portletItem odd')"> 324 <span i18n:translate="no_published_blog_entries">No blog entries are published.</span> 250 325 <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/> 251 </tal:entries> 252 <div class="portletContent content even" tal:condition="not: recent"> 253 <strong i18n:translate="recent_additions">Recent additions:</strong> 254 </div> 255 <div class="portletContent content odd" tal:condition="not: recent"> 256 <span i18n:translate="no_published_blog_entries">No blog entries are published.</span> 257 <tal:toggle tal:define="global toggle python:0"/> 258 </div> 326 </dd> 259 327 </div> 260 328 … … 263 331 tal:define="DateTime python:modules['DateTime'].DateTime; 264 332 current python:DateTime(); 265 month python:request.get('month', DateTime().month()); 266 year python:request.get('year', DateTime().year()); 333 anchor_url request/anchor_url | here_url; 334 anchor_method request/anchor_method | template/getId; 335 yearmonth here/getYearAndMonthToDisplay; 336 nextYearMax python: current+365; 337 prevYearMin python: current-365; 338 year python:yearmonth[0]; 339 month python:yearmonth[1]; 267 340 prevMonthTime python:here.getPreviousMonth(month, year); 268 341 nextMonthTime python:here.getNextMonth(month, year); 269 342 weeks python:here.simpleblog_tool.getEventsForCalendar(month=month, year=year, context=here); 270 anchor_url request/anchor_url | here_url; 271 anchor_method request/anchor_method | template/getId; 343 translation_service nocall:here/translation_service; 344 day_msgid nocall:translation_service/day_msgid; 345 weekday_english nocall:translation_service/weekday_english; 346 utranslate nocall:here/utranslate; 347 toLocalizedTime nocall:here/toLocalizedTime; 272 348 published_state python:here.simpleblog_tool.getPublishedState()" 273 349 i18n:domain="plone"> … … 278 354 <tr> 279 355 <th id="calendar-previous"> 280 <a href="#" tal:attributes="href python:'%s/%s?month:int=%d&year:int=%d' % (anchor_url, anchor_method, prevMonthTime.month(),prevMonthTime.year())">«</a> 356 <a href="#" rel="nofollow" 357 title="Previous month" 358 tal:attributes="href python:'%s/%s?month:int=%d&year:int=%d' % (anchor_url, anchor_method, prevMonthTime.month(),prevMonthTime.year())" 359 tal:condition="python: yearmonth > (prevYearMin.year(), prevYearMin.month())" 360 i18n:attributes="title title_previous_month;">«</a> 281 361 </th> 282 <th colspan="5" 283 tal:define="date string:$month/1/$year;"> 362 <th colspan="5"> 284 363 <span i18n:translate="" tal:omit-tag=""> 285 <span i18n:name="monthname"> 286 <span i18n:translate="" 287 tal:define="monthstring python:DateTime(date).strftime('%B').capitalize();" 288 tal:attributes="id string:calendar-month-$monthstring" 289 tal:content="string:$monthstring" 290 id="calendar-month-month"> </span> 291 </span> 364 <span i18n:name="monthname" 365 tal:define="month_english python:translation_service.month_english(month);" 366 tal:attributes="id string:calendar-month-$month_english" 367 tal:content="python: utranslate(translation_service.month_msgid(month), default=month_english)" 368 tal:omit-tag="" 369 id="calendar-month-month">monthname</span> 292 370 <span i18n:name="year" 293 tal:define="year python:DateTime(date).year()"294 371 tal:content="string:$year" 295 372 tal:attributes="id string:calendar-year-$year;" 296 id="calendar-year"> </span> 373 tal:omit-tag="" 374 id="calendar-year">year</span> 297 375 </span> 298 </th> 299 <th id="calendar-next" tal:on-error="string:"> 300 <a href="#" tal:attributes="href python:'%s/%s?month:int=%d&year:int=%d' % (anchor_url, anchor_method, nextMonthTime.month(),nextMonthTime.year())">»</a> 376 </th> 377 <th id="calendar-next"> 378 <a href="#" rel="nofollow" 379 title="Next month" 380 tal:attributes="href python:'%s/%s?month:int=%d&year:int=%d' % (anchor_url, anchor_method, nextMonthTime.month(),nextMonthTime.year())" 381 tal:condition="python: yearmonth < (nextYearMax.year(), nextYearMax.month())" 382 i18n:attributes="title title_next_month;">»</a> 301 383 </th> 302 384 </tr> 303 <tr tal:define="weekdays here/portal_calendar/getDays" class="weekdays"> 304 <tal:block repeat="weekday weekdays"> 305 <td i18n:translate="" tal:content="weekday">Su</td> 306 </tal:block> 385 <tr tal:define="weekdaynumbers here/portal_calendar/getDayNumbers" class="weekdays"> 386 <tal:data tal:repeat="daynumber weekdaynumbers"> 387 <td tal:define="weekday_english python:weekday_english(daynumber,format='a');" 388 tal:content="python: utranslate(day_msgid(daynumber, format='s'), default=weekday_english)">Su</td> 389 </tal:data> 307 390 </tr> 308 391 </thead> SimpleBlog/trunk/skins/SimpleBlog/blogentry_view.pt
r555 r556 15 15 <tal:block tal:define="obj python:here"> 16 16 17 18 <div metal:define-macro="full" tal:define="showReadMore python:0">19 20
