Changeset 555 in products


Ignore:
Timestamp:
Sep 29, 2006 3:53:51 PM (20 years ago)
Author:
mylan
Message:

Add Delicious,Digg,Yahoo,Google,Spurl bookmarklets. Refactoring SimpleBlog_macros. Hide unused categories from portlet.

Location:
SimpleBlog/branches/plone-2.1-Blogging-APIs
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • SimpleBlog/branches/plone-2.1-Blogging-APIs/config.py

    • Property svn:eol-style deleted
    r28 r555  
     1from Permissions import * 
    12from Products.Archetypes.public import DisplayList 
    23 
     
    56 
    67GLOBALS = globals() 
    7 ENABLE_ADSENSE = 1 
    88 
    9 # deprecated, just here for compatability 
    109DISPLAY_MODE = DisplayList(( 
    11     ('full', 'Full'), ('descriptionOnly', 'Description only'), ('titleOnly', 'Title only') )) 
    12  
    13  
    14 # set to 0 if you don't want entries to be folderish 
    15 # use at your own risk. this is not fully tested 
    16 ENTRY_IS_FOLDERISH = 1 
    17  
     10    ('full', 'Full', 'display_full'),  
     11    ('descriptionOnly', 'Description only', 'display_description_only'),  
     12    ('titleOnly', 'Title only', 'display_title_only') )) 
    1813 
    1914DIGG_TOPICS = DisplayList(( \ 
  • SimpleBlog/branches/plone-2.1-Blogging-APIs/skins/SimpleBlog/SimpleBlog_macros.pt

    r211 r555  
    44<body> 
    55 
     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 
    618<div metal:define-macro="full" tal:define="showReadMore python:0" class="simpleBlogEntry"> 
     19    <div metal:use-macro="obj/SimpleBlog_macros/macros/blogGlobals"/> 
    720    <div tal:define="size headerSize | python:1;title obj/title_or_id; 
    8                          showIcons obj/simpleblog_tool/getShowIcons"  
     21                    showIcons fp/simpleblog_tool/getShowIcons"  
    922             class="simpleBlogTitle"> 
    1023                <tal:x replace='structure string:<h${size} class="noMargin">'/> 
     
    2538 
    2639<div metal:define-macro="descriptionOnly"  tal:define="showReadMore python:1" class="simpleBlogEntry"> 
     40    <div metal:use-macro="obj/SimpleBlog_macros/macros/blogGlobals"/> 
    2741    <div tal:define="size headerSize | python:1;title obj/title_or_id; 
    28                          showIcons obj/simpleblog_tool/getShowIcons"  
     42                    showIcons fp/simpleblog_tool/getShowIcons"  
    2943             class="simpleBlogTitle"> 
    3044                <tal:x replace='structure string:<h${size} class="noMargin">'/> 
     
    4458 
    4559<div metal:define-macro="titleOnly" tal:define="showReadMore python:1" class="simpleBlogTitle"> 
     60    <div metal:use-macro="obj/SimpleBlog_macros/macros/blogGlobals"/> 
    4661    <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"> 
    4863                <tal:x replace='structure string:<h${size} class="noMargin">'/> 
    4964            <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;"> 
     
    5873</div> 
    5974 
    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);"> 
    6177     <span i18n:translate="blog_by_line"> 
    6278    Submitted by  
     
    7187                <strong><a href="#"  
    7288                           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}" 
    7490                           title="category"><span  tal:omit-tag="" tal:content="cat"/></a></strong> 
    7591           </tal:categories> 
     
    7995 
    8096<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" 
    83100     tal:omit-tag=""> 
    84101     _____<br/> 
     
    97114    <tal:x define="allowed python:obj.portal_discussion.isDiscussionAllowedFor(obj); 
    98115                   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)"> 
    101119         <span i18n:translate="blog_by_line"> 
    102120         <span tal:define="edate python:obj.simpleblog_tool.getEntryDate(obj)" 
     
    111129                    <strong><a href="#"  
    112130                               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}" 
    114132                               title="category"><span  tal:omit-tag="" tal:content="cat"/></a></strong> 
    115133               </tal:categories> 
     
    128146         <div tal:condition="tballowed"> trackback URL: &nbsp; 
    129147               <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>&nbsp;<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>&nbsp;<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>&nbsp;<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>&nbsp;<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> 
    130201         </div> 
    131202 
     
    205276    <tal:cats tal:repeat="cat python:here.simpleblog_tool.getSortedKeys(cats)"> 
    206277        <dd tal:define="pss modules/Products.PythonScripts.standard; 
     278                        fp nocall:fp | python:here.simpleblog_tool.getFrontPage(here); 
    207279                        quotedCat python:pss.url_quote(cat); 
    208280                        category python:'%s (%s)' %(cat,cats[cat])" 
     281            tal:condition="python:cats[cat]>0" 
    209282            tal:attributes="class python:test(toggle, 'portletItem even', 'portletItem odd')"> 
    210             <a tal:condition="python:cats[cat]>0"  href="#"  
    211                            tal:attributes="href string:${here/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}; 
    212                                            title cat"><span tal:content="category"/></a> 
    213                         <span tal:condition="python:cats[cat]==0" tal:content="category"/>  
     283            <a href="#"  
     284               tal:attributes="href string:${fp/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}; 
     285                               title cat"><span tal:content="category"/></a> 
    214286            <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/> 
    215287        </dd> 
  • SimpleBlog/branches/plone-2.1-Blogging-APIs/util.py

    • Property svn:eol-style deleted
Note: See TracChangeset for help on using the changeset viewer.