Changeset 583
- Timestamp:
- 10/19/06 09:35:41
- Files:
-
- SimpleBlog/branches/plone-2.5/BloggerAPI.py (added)
- SimpleBlog/branches/plone-2.5/MetaWeblogAPI.py (added)
- SimpleBlog/branches/plone-2.5/MovableTypeAPI.py (added)
- SimpleBlog/branches/plone-2.5/SimpleBlogTool.py (modified) (1 diff)
- SimpleBlog/branches/plone-2.5/skins/SimpleBlog/SimpleBlog_macros.pt (modified) (1 diff)
- SimpleBlog/branches/plone-2.5/skins/SimpleBlog/blogentry_view.pt (modified) (1 diff)
- SimpleBlog/branches/plone-2.5/skins/SimpleBlog/blogfolder_view.pt (modified) (1 diff)
- SimpleBlog/branches/plone-2.5/skins/SimpleBlog/simpleblog_view.pt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
SimpleBlog/branches/plone-2.5/SimpleBlogTool.py
r582 r583 31 31 self.manage_addProperty('createPortletOnBlogCreation', 1,'boolean') 32 32 33 security.declarePublic('getByUID') 34 def getByUID(self, uid): 35 "Shortcut method for the [Blogger,MetaWeblog]API code" 36 37 uid_catalog = getToolByName(self, 'uid_catalog') 38 lazy_cat = uid_catalog(UID=uid) 39 o = lazy_cat[0].getObject() 40 return o 41 42 security.declarePublic('findRPCAuth') 43 def findRPCAuth(self, parent): 44 while hasattr(parent,'aq_parent'): 45 RPCAuths = parent.objectValues('RPC Auth') 46 for RPCAuth in RPCAuths: 47 return RPCAuth 48 parent = parent.aq_parent 49 return None 50 33 51 34 52 security.declarePublic('idFromTitle') 35 53 def idFromTitle(self, title): 36 54 id = re.sub('[^A-Za-z0-9_]', '', re.sub(' ', '_', title)).lower() 37 return id 38 55 return id 56 39 57 def _getState(self): 40 58 try: SimpleBlog/branches/plone-2.5/skins/SimpleBlog/SimpleBlog_macros.pt
r582 r583 5 5 6 6 <div metal:define-macro="full" class="simpleBlogFull"> 7 8 <h2 class="noMargin"tal:define="item_type obj/portal_type;9 item_type_class python:'contenttype-' + normalizeString(item_type);">7 <h2 class="noMargin" 8 tal:define="item_type obj/portal_type; 9 item_type_class python:'contenttype-' + normalizeString(item_type);"> 10 10 <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;"> 11 11 <span tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="obj/title"/> 12 12 </a> 13 13 </h2> 14 15 14 <tal:byline metal:use-macro="obj/simpleblog_byline/macros/byline"/> 16 <p class="simpleBlogDescription" 17 tal:content="structure python:obj.Description()" 18 tal:condition="obj/Description"> 19 Description 20 </p> 21 15 <p class="simpleBlogDescription" 16 tal:content="structure python:obj.Description()" 17 tal:condition="obj/Description">Description</p> 22 18 <div tal:replace="structure python:obj.getBody()" class="simpleBlogBody"/> 23 19 </div> 24 20 25 21 <div metal:define-macro="descriptionOnly" class="simpleBlogDescriptionOnly"> 26 <h2 class="noMargin" tal:define="item_type obj/portal_type; 27 item_type_class python:'contenttype-' + normalizeString(item_type);"> 22 <h2 class="noMargin" 23 tal:define="item_type obj/portal_type; 24 item_type_class python:'contenttype-' + normalizeString(item_type);"> 28 25 <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;"> 29 <span tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="obj/title"/>26 <span tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="obj/title"/> 30 27 </a> 31 28 </h2> 32 29 <tal:byline metal:use-macro="obj/simpleblog_byline/macros/byline"/> 33 <p class="simpleBlogDescription" 34 tal:content="structure python:obj.Description()" 35 tal:condition="obj/Description"> 36 Description 37 </p> 30 <p class="simpleBlogDescription" 31 tal:content="structure python:obj.Description()" 32 tal:condition="obj/Description">Description</p> 38 33 </div> 39 34 40 35 <div metal:define-macro="titleOnly" class="simpleBlogTitleOnly"> 41 <h2 class="noMargin" tal:define="item_type obj/portal_type; 42 item_type_class python:'contenttype-' + normalizeString(item_type);"> 36 <h2 class="noMargin" 37 tal:define="item_type obj/portal_type; 38 item_type_class python:'contenttype-' + normalizeString(item_type);"> 43 39 <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;"> 44 <span tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="obj/title"/>40 <span tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="obj/title"/> 45 41 </a> 46 42 </h2> SimpleBlog/branches/plone-2.5/skins/SimpleBlog/blogentry_view.pt
r582 r583 3 3 metal:use-macro="here/main_template/macros/master" 4 4 i18n:domain="SimpleBlog"> 5 6 5 <body> 7 6 <div metal:fill-slot="main"> 8 7 <tal:main-macro metal:define-macro="main"> 9 8 <tal:block tal:define="obj python:here"> 10 11 12 <div metal:define-macro="full" tal:define="showReadMore python:0"> 13 14 <div metal:use-macro="here/document_actions/macros/document_actions"> 15 Document actions (print, sendto etc) 16 </div> 17 18 <h1 tal:content="object_title" class="documentFirstHeading"> 19 Title or id 20 </h1> 21 22 <tal:byline metal:use-macro="obj/simpleblog_byline/macros/byline-long"/> 23 24 <p class="documentDescription" 25 tal:content="structure here/Description" 26 tal:condition="here/Description"> 27 Description 28 </p> 29 30 <div tal:replace="structure python:obj.getBody()" /> 31 32 <tal:foreign tal:define="crossPosts here/getCrossPosts|nothing" tal:condition="crossPosts"> 33 <h3> 34 This entry is cross-posted in the following blogs: 35 </h3> 36 <p> 37 <tal:block tal:repeat="blog crossPosts"> 38 <img src="simpleblog_icon.gif" /> 39 <a href="" 40 tal:attributes="href blog/absolute_url; 41 title blog/Title;" 42 tal:content="blog/Title" /> 43 <br /> 44 </tal:block> 45 </p> 46 </tal:foreign> 47 </div> 48 9 <div metal:define-macro="full" tal:define="showReadMore python:0"> 10 <div metal:use-macro="here/document_actions/macros/document_actions"> 11 Document actions (print, sendto etc) 12 </div> 13 <h1 tal:content="object_title" class="documentFirstHeading"> 14 Title or id 15 </h1> 16 <tal:byline metal:use-macro="obj/simpleblog_byline/macros/byline-long"/> 17 <p class="documentDescription" 18 tal:content="structure here/Description" 19 tal:condition="here/Description"> 20 Description 21 </p> 22 <div tal:replace="structure python:obj.getBody()" /> 23 </div> 49 24 </tal:block> 50 51 </tal:main-macro> 25 </tal:main-macro> 52 26 </div> 53 54 27 </body> 55 56 28 </html> SimpleBlog/branches/plone-2.5/skins/SimpleBlog/blogfolder_view.pt
r582 r583 6 6 7 7 <body> 8 9 8 <div metal:fill-slot="main"> 10 9 <tal:main-macro metal:define-macro="main"> 11 12 10 <h1 class="documentFirstHeading"> 13 11 <img id="pagetype_icon" src="#" tal:attributes="src string:${here/portal_url}/${here/getIcon};alt here/title" /> 14 12 <span tal:replace="here/title_or_id"/> 15 13 </h1> 16 17 14 <p>This template is no longer used. Please reinstall SimpleBlog to make use of the new display mechanism or ask 18 15 your administrator to do so. SimpleBlog/branches/plone-2.5/skins/SimpleBlog/simpleblog_view.pt
r582 r583 3 3 metal:use-macro="here/main_template/macros/master" 4 4 i18n:domain="SimpleBlog"> 5 6 7 5 <body> 8 6 <div metal:fill-slot="main"> 9 7 <tal:main-macro metal:define-macro="main" 10 8 tal:define="displayItems python:here.getDisplayItems(); 11 warnForUnpublishedEntries python:here.getWarnForUnpublishedEntries(); 12 displayMode displayMode | python:here.getDisplayMode(); 13 results python:here.getEntries(maxResults=0, sort=1, join=1, addCrossPostInfo=1); 14 b_size python:displayItems; 15 b_start python:0; 16 b_start request/b_start | b_start; 17 Batch python:modules['Products.CMFPlone'].Batch;"> 18 9 displayMode displayMode | python:here.getDisplayMode(); 10 results python:here.getEntries(maxResults=0, sort=1, join=1, addCrossPostInfo=1); 11 b_size python:displayItems; 12 b_start python:0; 13 b_start request/b_start | b_start; 14 Batch python:modules['Products.CMFPlone'].Batch;"> 19 15 <div metal:use-macro="here/document_actions/macros/document_actions"> 20 16 Document actions (print, sendto etc) 21 17 </div> 22 23 18 <h1 tal:content="object_title" class="documentFirstHeading"> 24 19 Title or id 25 20 </h1> 26 27 21 <div metal:use-macro="here/document_byline/macros/byline"> 28 22 Get the byline - contains details about author and modification date. 29 23 </div> 30 31 <tal:warning tal:condition="here/getWarnForUnpublishedEntries"> 32 <tal:block tal:define="unpublishedEntries python:here.simpleblog_tool.getUnpublishedEntries(here);"> 33 <div class="portalMessage simpleBlogUnpublishedWarningbox" tal:condition="unpublishedEntries"> 34 There are <span tal:content="python:len(unpublishedEntries)" /> unpublished entries in this blog. 35 To see and manage all the existing entries 36 in this blog, click <a href="folder_contents">here</a>. 37 </div> 38 </tal:block> 39 </tal:warning> 40 41 24 <tal:warning tal:condition="here/getWarnForUnpublishedEntries"> 25 <tal:block tal:define="unpublishedEntries python:here.simpleblog_tool.getUnpublishedEntries(here);"> 26 <div class="portalMessage simpleBlogUnpublishedWarningbox" tal:condition="unpublishedEntries"> 27 There are <span tal:content="python:len(unpublishedEntries)" /> unpublished entries in this blog. To see and manage all the existing entries in this blog, click <a href="folder_contents">here</a> 28 </div> 29 </tal:block> 30 </tal:warning> 42 31 <p class="documentDescription" 43 32 tal:content="here/Description" … … 45 34 Description 46 35 </p> 47 48 36 <div tal:condition="results" tal:define="batch python:Batch(results, b_size, int(b_start), orphan=1);"> 49 37 <tal:block tal:repeat="entry batch"> 50 38 <tal:entry tal:define="obj python:entry[0]; 51 isCrossPost python:entry[1];">39 isCrossPost python:entry[1];"> 52 40 <div metal:use-macro="here/SimpleBlog_macros/macros/?displayMode"/> 53 41 </tal:entry> … … 55 43 <div metal:use-macro="here/batch_macros/macros/navigation" /> 56 44 </div> 57 58 45 <tal:info tal:condition="not: results"> 59 46 <tal:block tal:define="hasEntries python:here.simpleblog_tool.blogHasEntries(here);"> … … 72 59 </tal:main-macro> 73 60 </div> 74 75 61 </body> 76 62
