Changeset 590
- Timestamp:
- 10/23/06 05:03:05
- Files:
-
- SimpleBlog/branches/plone-2.5/config.py (modified) (1 diff)
- SimpleBlog/branches/plone-2.5/content/blog.py (modified) (7 diffs)
- SimpleBlog/branches/plone-2.5/skins/SimpleBlog/SimpleBlog_macros.pt (modified) (1 diff)
- SimpleBlog/branches/plone-2.5/skins/SimpleBlog/blogentry_view.pt (modified) (2 diffs)
- SimpleBlog/branches/plone-2.5/skins/SimpleBlog/simpleblog_byline.pt (modified) (4 diffs)
- SimpleBlog/branches/plone-2.5/skins/SimpleBlog/simpleblog_view.pt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
SimpleBlog/branches/plone-2.5/config.py
r589 r590 5 5 6 6 GLOBALS = globals() 7 ENABLE_ADSENSE = 1 7 8 8 9 # deprecated, just here for compatability SimpleBlog/branches/plone-2.5/content/blog.py
r589 r590 5 5 from Products.CMFCore import CMFCorePermissions 6 6 from DateTime import DateTime 7 from Products.SimpleBlog.config import DISPLAY_MODE 7 from Products.SimpleBlog.config import DISPLAY_MODE, ENABLE_ADSENSE 8 8 import Products.SimpleBlog.Permissions 9 9 from Products.CMFCore.utils import getToolByName … … 20 20 isMetadata=1, 21 21 accessor='Description', 22 searchable=1, 23 widget=TextAreaWidget(label='Description', 22 searchable=1, 23 widget=TextAreaWidget(label='Description', 24 24 label_msgid="label_blog_description", 25 25 description_msgid="help_blog_description", … … 161 161 description_msgid = "help_enable_top_adsence", 162 162 i18n_domain = "SimpleBlog", 163 description = None)), 163 description = None, 164 condition="python:%s" % ENABLE_ADSENSE)), 164 165 StringField('topAdsence', 165 166 schemata = 'interface', … … 170 171 description_msgid = "help_top_adsence", 171 172 i18n_domain = "SimpleBlog", 172 description = None)), 173 description = None, 174 condition="python:%s" % ENABLE_ADSENSE)), 173 175 BooleanField('enableBottomAdsence', 174 176 schemata = 'interface', … … 180 182 description_msgid = "help_enable_bottom_adsence", 181 183 i18n_domain = "SimpleBlog", 182 description = None)), 184 description = None, 185 condition="python:%s" % ENABLE_ADSENSE)), 183 186 StringField('bottomAdsence', 184 187 schemata = 'interface', … … 189 192 description_msgid = "help_bottom_adsence", 190 193 i18n_domain = "SimpleBlog", 191 description = None)), 194 description = None, 195 condition="python:%s" % ENABLE_ADSENSE)), 192 196 )) 193 197 … … 278 282 query['getAlwaysOnTop']=0 279 283 localNoTop = self.portal_catalog.searchResults(query, meta_type='BlogEntry', path={'query':self.simpleblog_tool.getObjectPath(self),'level':0}, sort_order='reverse', sort_on='effective') 280 localNoTop= [r.getObject() for r in localNoTop] 284 localNoTop= [r.getObject() for r in localNoTop] 281 285 282 286 # foreign items SimpleBlog/branches/plone-2.5/skins/SimpleBlog/SimpleBlog_macros.pt
r589 r590 4 4 <body> 5 5 6 <div metal:define-macro="blogGlobals" 7 tal:define="global blog python:here.simpleblog_tool.getFrontPage(here); 8 global isDeliciousEnaled blog/isDeliciousEnabled; 9 global isDiggEnabled blog/isDiggEnabled; 10 global isYahooEnabled blog/isYahooEnabled; 11 global isGoogleEnabled blog/isGoogleEnabled; 12 global isSpurlEnabled blog/isSpurlEnabled; 13 global isTagsEnabled blog/isTagsEnabled; 14 global isAllowTrackback blog/getAllowTrackback; 15 global showIcons blog/getShowIcons; 16 global showByline blog/getShowByline; 17 global isTopAdsenceEnabled blog/isTopAdsenceEnabled; 18 global isBottomAdsenceEnabled blog/isBottomAdsenceEnabled; 19 global bottomAdsence blog/getBottomAdsence; 20 global topAdsence blog/getTopAdsence;" 21 tal:omit-tag=""> 22 </div> 23 6 24 <div metal:define-macro="full" class="simpleBlogFull"> 7 <h2 class="noMargin" 8 tal:define="item_type obj/portal_type; 9 item_type_class python:'contenttype-' + normalizeString(item_type);"> 25 <h2 class="noMargin" 26 tal:condition="showIcons"> 10 27 <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;"> 11 <span tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="obj/title"/> 12 </a> 28 <span tal:define="item_type obj/portal_type; 29 item_type_class python:'contenttype-' + normalizeString(item_type);" 30 tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="obj/title"/></a> 13 31 </h2> 14 <tal:byline metal:use-macro="obj/simpleblog_byline/macros/byline"/> 32 <h2 class="noMargin" tal:condition="not:showIcons"> 33 <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;" 34 tal:content="obj/title"></a> 35 </h2> 15 36 <p class="simpleBlogDescription" 16 37 tal:content="structure python:obj.Description()" 17 38 tal:condition="obj/Description">Description</p> 18 39 <div tal:replace="structure python:obj.getBody()" class="simpleBlogBody"/> 40 <tal:tags metal:use-macro="obj/simpleblog_byline/macros/technoratiTags"/> 41 <tal:byline tal:condition="showByline"> 42 <tal:x metal:use-macro="obj/simpleblog_byline/macros/byline-foot"/> 43 </tal:byline> 19 44 </div> 20 45 21 46 <div metal:define-macro="descriptionOnly" class="simpleBlogDescriptionOnly"> 22 <h2 class="noMargin" 23 tal:define="item_type obj/portal_type; 24 item_type_class python:'contenttype-' + normalizeString(item_type);"> 47 <h2 class="noMargin" 48 tal:condition="showIcons"> 25 49 <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;"> 26 <span tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="obj/title"/> 27 </a> 50 <span tal:define="item_type obj/portal_type; 51 item_type_class python:'contenttype-' + normalizeString(item_type);" 52 tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="obj/title"/></a> 28 53 </h2> 29 <tal:byline metal:use-macro="obj/simpleblog_byline/macros/byline"/> 54 <h2 class="noMargin" tal:condition="not:showIcons"> 55 <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;" 56 tal:content="obj/title"></a> 57 </h2> 30 58 <p class="simpleBlogDescription" 31 59 tal:content="structure python:obj.Description()" 32 60 tal:condition="obj/Description">Description</p> 61 <tal:tags metal:use-macro="obj/simpleblog_byline/macros/technoratiTags"/> 62 <tal:byline tal:condition="showByline"> 63 <tal:x metal:use-macro="obj/simpleblog_byline/macros/byline-foot"/> 64 </tal:byline> 33 65 </div> 34 66 35 67 <div metal:define-macro="titleOnly" class="simpleBlogTitleOnly"> 36 <h2 class="noMargin" 37 tal:define="item_type obj/portal_type; 38 item_type_class python:'contenttype-' + normalizeString(item_type);"> 68 <h2 class="noMargin" 69 tal:condition="showIcons"> 39 70 <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;"> 40 <span tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="obj/title"/> 41 </a> 71 <span tal:define="item_type obj/portal_type; 72 item_type_class python:'contenttype-' + normalizeString(item_type);" 73 tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="obj/title"/></a> 42 74 </h2> 43 <tal:byline metal:use-macro="obj/simpleblog_byline/macros/byline"/> 75 <h2 class="noMargin" tal:condition="not:showIcons"> 76 <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;" 77 tal:content="obj/title"></a> 78 </h2> 79 <tal:tags metal:use-macro="obj/simpleblog_byline/macros/technoratiTags"/> 80 <tal:byline tal:condition="showByline"> 81 <tal:x metal:use-macro="obj/simpleblog_byline/macros/byline-foot"/> 82 </tal:byline> 44 83 </div> 45 84 SimpleBlog/branches/plone-2.5/skins/SimpleBlog/blogentry_view.pt
r589 r590 7 7 <tal:main-macro metal:define-macro="main"> 8 8 <tal:block tal:define="obj python:here"> 9 <div metal:define-macro="full" tal:define="showReadMore python:0"> 9 <div metal:define-macro="full"> 10 <tal:block metal:use-macro="here/SimpleBlog_macros/macros/blogGlobals"/> 10 11 <div metal:use-macro="here/document_actions/macros/document_actions"> 11 12 Document actions (print, sendto etc) 12 13 </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"/> 14 <h1 class="documentFirstHeading" 15 tal:condition="showIcons"> 16 <span tal:define="item_type obj/portal_type; 17 item_type_class python:'contenttype-' + normalizeString(item_type);" 18 tal:attributes="class string:simpleBlogIcons ${item_type_class}" tal:content="object_title"/></h1> 19 <h1 class="documentFirstHeading" 20 tal:content="object_title" 21 tal:condition="not:showIcons"></h1> 22 <span metal:use-macro="obj/review_history/macros/review_history" /> 17 23 <p class="documentDescription" 18 24 tal:content="structure here/Description" … … 20 26 Description 21 27 </p> 28 <div style="float:left;" 29 tal:condition="isTopAdsenceEnabled"> 30 <div tal:replace="structure python:path('/here/'+topAdsence)" 31 tal:on-error="string: "></div></div> 22 32 <div tal:replace="structure python:obj.getBody()" /> 33 <div style="float:left;" 34 tal:condition="isBottomAdsenceEnabled"> 35 <div tal:replace="structure python:path('/here/'+bottomAdsence)" 36 tal:on-error="string: "></div></div> 37 <tal:tags metal:use-macro="obj/simpleblog_byline/macros/technoratiTags"/> 38 <tal:byline tal:condition="showByline"> 39 <tal:x metal:use-macro="obj/simpleblog_byline/macros/byline-foot"/> 40 </tal:byline> 23 41 </div> 24 42 </tal:block> 25 43 </tal:main-macro> 26 44 </div> 45 <div metal:fill-slot="sub"> 46 <tal:block tal:condition="showByline"> <metal:discussion use-macro="here/viewThreadsAtBottom/macros/discussionView" /></tal:block> 47 </div> 48 27 49 </body> 28 50 </html> SimpleBlog/branches/plone-2.5/skins/SimpleBlog/simpleblog_byline.pt
r589 r590 1 <metal:bookmarklets metal:define-macro="bookmarklets" 2 tal:condition="isDeliciousEnaled|isDiggEnabled|isYahooEnabled|isGoogleEnabled|isSpurlEnabled"><div 3 tal:define="entryURL obj/absolute_url; 4 entryTitle obj/Title; 5 entryDescription obj/Description; 6 entryDiggTopic obj/getDiggTopic; 7 encodeURLData python:modules['Products.SimpleBlog.util'].encodeURLData;"> 8 <span tal:condition="isDeliciousEnaled"> 9 <a href="" 10 title="" 11 tal:define="url_data python:encodeURLData({'url':entryURL,'title':entryTitle});" 12 tal:attributes="href string:http://del.icio.us/post?${url_data}; 13 title string:del.icio.us: ${entryTitle}"> 14 <img src="" 15 alt="del.icio.us" 16 tal:attributes="src string:$portal_url/delicious.gif;" /></a> 17 </span> <span tal:condition="isDiggEnabled"> 18 <a href="" 19 title="" 20 tal:define="url_data python:encodeURLData({'phase':'2','url':entryURL,'title':entryTitle,'bodytext':entryDescription,'topic':entryDiggTopic});" 21 tal:attributes="href string:http://digg.com/submit?${url_data}; 22 title string:Digg: ${entryTitle}"> 23 <img src="" 24 alt="Digg" 25 tal:attributes="src string:$portal_url/digg.gif;" /></a> 26 </span> <span tal:condition="isYahooEnabled"> 27 <a href="" 28 title="" 29 tal:define="url_data python:encodeURLData({'u':entryURL,'t':entryTitle});" 30 tal:attributes="href string:http://myweb2.search.yahoo.com/myresults/bookmarklet?${url_data}; 31 title string:Yahoo: ${entryTitle}"> 32 <img src="" 33 alt="Yahoo" 34 tal:attributes="src string:$portal_url/yahoo.gif;" /></a> 35 </span> <span tal:condition="isGoogleEnabled"> 36 <a href="" 37 title="" 38 tal:define="url_data python:encodeURLData({'op':'edit','output':'popup','bkmk':entryURL,'title':entryTitle});" 39 tal:attributes="href string:http://www.google.com/bookmarks/mark?${url_data}; 40 title string:Google: ${entryTitle}"> 41 <img src="" 42 alt="Google" 43 tal:attributes="src string:$portal_url/google.gif;" /></a> 44 </span> <span tal:condition="isSpurlEnabled"> 45 <a href="" 46 title="" 47 tal:define="url_data python:encodeURLData({'url':entryURL,'title':entryTitle});" 48 tal:attributes="href string:http://www.spurl.net/spurl.php?${url_data}; 49 title string:Spurl: ${entryTitle}"> 50 <img src="" 51 alt="Spurl" 52 tal:attributes="src string:$portal_url/spurl.gif;" /></a> 53 </span> 54 </div></metal:bookmarklets> 55 56 <div metal:define-macro="byline-foot" class="BlogByLine"> 57 <tal:x define="allowed python:obj.portal_discussion.isDiscussionAllowedFor(obj); 58 ccount python:allowed and obj.portal_discussion.getDiscussionFor(obj).replyCount(obj); 59 tballowed isAllowTrackback | here/getAllowTrackback; 60 tbcount python:tballowed and len(obj.getTrackbacks()) or 0; 61 blog_url blog/absolute_url"> 62 <span i18n:translate="blog_by_line"> 63 <span tal:define="edate python:obj.simpleblog_tool.getEntryDate(obj)" 64 i18n:name="date" tal:replace="python:DateTime(edate).strftime('%A, %B %d, %Y')">Jun 2, 2002 2:42 pm</span> 65 </span><span tal:define="cats python:obj.EntryCategory(); 66 pss modules/Products.PythonScripts.standard;" 67 tal:omit-tag=""><tal:x tal:condition="cats"> in </tal:x><tal:categories 68 tal:repeat="cat cats" tal:condition="cats"> 69 <span tal:omit-tag="" tal:condition="not: repeat/cat/start">| </span><strong><a href="#" 70 tal:define="quotedCat python:pss.url_quote(cat)" 71 tal:attributes="href string:${blog/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}" 72 title="category"><span tal:omit-tag="" tal:content="cat"/></a></strong></tal:categories> 73 </span> | <strong><a href="" 74 tal:attributes="href obj/absolute_url" 75 i18n:translate="permalink">Permalink</a></strong> | <tal:block condition="allowed"> 76 <strong> 77 <a href="" 78 tal:attributes="href string:${obj/absolute_url}#comments" 79 tal:content="string:Comments (${ccount})">Comments</a></strong><tal:x condition="tbcount"> | </tal:x></tal:block> 80 <strong tal:condition="python:tballowed and tbcount"> 81 <tal:x tal:replace="string:TrackBack (${tbcount})">TrackBack</tal:x> 82 </strong><div tal:condition="tballowed"> trackback URL: <tal:x replace="string:${obj/absolute_url}/sbtrackback"/> 83 </div><div metal:use-macro="here/simpleblog_byline/macros/bookmarklets"></div></tal:x> 84 </div> 85 86 <div metal:define-macro="technoratiTags" 87 tal:define="cats python:obj.EntryTag(); 88 isTagsEnabled isTagsEnabled | here/isTagsEnabled" 89 tal:condition="python:isTagsEnabled and cats" 90 tal:omit-tag=""> 91 _____<br/> 92 tags: 93 <span class="simpleBlogBylineCats"><tal:categories 94 tal:repeat="cat cats" tal:condition="cats"><span tal:omit-tag="" tal:condition="not: repeat/cat/start">| 95 </span><strong><a href="#" 96 rel="tag" 97 tal:define="quotedCat python:cat.lower().replace(' ', '+')" 98 tal:attributes="href string:http://www.technorati.com/tag/${quotedCat}"><span tal:omit-tag="" 99 tal:content="cat"/></a></strong></tal:categories></span> 100 </div> 101 102 1 103 <div metal:define-macro="byline" class="documentByLine BlogByLine" 2 104 tal:condition="python: site_properties.allowAnonymousViewAbout or not isAnon" 3 105 tal:define="creator obj/Creator;"> 4 5 <tal:crosspost tal:define="isCrossPost isCrossPost|python:0" tal:condition="isCrossPost">6 <img class="simpleBlogCrosspost" src="cross-post.gif" title="Cross-post"/>7 </tal:crosspost>8 106 <tal:name tal:condition="creator" 9 107 tal:define="author python:mtool.getMemberInfo(creator)"> … … 23 121 <span i18n:name="date" tal:replace="python:obj.toLocalizedTime(obj.simpleblog_tool.getEntryDate(obj), long_format=1)">Jun 2, 2002 2:42 pm</span> 24 122 </span> 25 —26 <tal:block tal:define="comments python:obj.portal_discussion.getDiscussionFor(obj)">27 <span tal:content="python:comments.replyCount(obj)" /> comment(s)28 </tal:block>29 —123 — 124 <tal:block tal:define="comments python:obj.portal_discussion.getDiscussionFor(obj)"> 125 <span tal:content="python:comments.replyCount(obj)" /> comment(s) 126 </tal:block> 127 — 30 128 <span tal:define="cats python:obj.EntryCategory(); 31 129 pss modules/Products.PythonScripts.standard;" … … 79 177 August 16, 2001 at 23:35:59 80 178 </span> 81 —179 — 82 180 <span class="state-expired" 83 181 tal:condition="python:portal.isExpired(obj)" 84 182 i18n:translate="time_expired"> 85 183 expired 86 —184 — 87 185 </span> 88 186 <span tal:define="cats python:obj.EntryCategory(); … … 112 210 </div> 113 211 </tal:rights> 114 <span metal:use-macro="obj/review_history/macros/review_history" /> 115 </div> 212 213 </div> SimpleBlog/branches/plone-2.5/skins/SimpleBlog/simpleblog_view.pt
r589 r590 13 13 b_start request/b_start | b_start; 14 14 Batch python:modules['Products.CMFPlone'].Batch;"> 15 <tal:block metal:use-macro="here/SimpleBlog_macros/macros/blogGlobals"/> 15 16 <div metal:use-macro="here/document_actions/macros/document_actions"> 16 17 Document actions (print, sendto etc) … … 35 36 </p> 36 37 <div tal:condition="results" tal:define="batch python:Batch(results, b_size, int(b_start), orphan=1);"> 37 <tal:block tal:repeat="entry batch"> 38 <tal:entry tal:define="obj python:entry[0]; 39 isCrossPost python:entry[1];"> 40 <div metal:use-macro="here/SimpleBlog_macros/macros/?displayMode"/> 41 </tal:entry> 42 </tal:block> 38 <tal:block tal:repeat="entry batch"><tal:entry 39 tal:define="obj python:entry[0]; 40 isCrossPost python:entry[1];"><div metal:use-macro="here/SimpleBlog_macros/macros/?displayMode"/> 41 <br/> 42 </tal:entry></tal:block> 43 43 <div metal:use-macro="here/batch_macros/macros/navigation" /> 44 44 </div>
