Changeset 590

Show
Ignore:
Timestamp:
10/23/06 05:03:05
Author:
chervol
Message:

skin views update

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • SimpleBlog/branches/plone-2.5/config.py

    r589 r590  
    55 
    66GLOBALS = globals() 
     7ENABLE_ADSENSE = 1 
    78 
    89# deprecated, just here for compatability 
  • SimpleBlog/branches/plone-2.5/content/blog.py

    r589 r590  
    55from Products.CMFCore import CMFCorePermissions 
    66from DateTime import DateTime 
    7 from Products.SimpleBlog.config import DISPLAY_MODE 
     7from Products.SimpleBlog.config import DISPLAY_MODE, ENABLE_ADSENSE 
    88import Products.SimpleBlog.Permissions 
    99from Products.CMFCore.utils import getToolByName 
     
    2020                isMetadata=1, 
    2121                accessor='Description', 
    22                 searchable=1,                 
    23                 widget=TextAreaWidget(label='Description',  
     22                searchable=1, 
     23                widget=TextAreaWidget(label='Description', 
    2424                                      label_msgid="label_blog_description", 
    2525                                      description_msgid="help_blog_description", 
     
    161161                           description_msgid = "help_enable_top_adsence", 
    162162                           i18n_domain = "SimpleBlog", 
    163                            description = None)), 
     163                           description = None, 
     164                           condition="python:%s" % ENABLE_ADSENSE)), 
    164165    StringField('topAdsence', 
    165166                schemata = 'interface', 
     
    170171                        description_msgid = "help_top_adsence", 
    171172                        i18n_domain = "SimpleBlog", 
    172                         description = None)), 
     173                        description = None, 
     174                        condition="python:%s" % ENABLE_ADSENSE)), 
    173175    BooleanField('enableBottomAdsence', 
    174176                 schemata = 'interface', 
     
    180182                           description_msgid = "help_enable_bottom_adsence", 
    181183                           i18n_domain = "SimpleBlog", 
    182                            description = None)), 
     184                           description = None, 
     185                           condition="python:%s" % ENABLE_ADSENSE)), 
    183186    StringField('bottomAdsence', 
    184187                schemata = 'interface',  
     
    189192                        description_msgid = "help_bottom_adsence", 
    190193                        i18n_domain = "SimpleBlog", 
    191                         description = None)), 
     194                        description = None, 
     195                           condition="python:%s" % ENABLE_ADSENSE)), 
    192196        )) 
    193197 
     
    278282        query['getAlwaysOnTop']=0 
    279283        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] 
    281285 
    282286        # foreign items 
  • SimpleBlog/branches/plone-2.5/skins/SimpleBlog/SimpleBlog_macros.pt

    r589 r590  
    44<body> 
    55 
     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 
    624<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"> 
    1027        <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> 
    1331    </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> 
    1536    <p class="simpleBlogDescription" 
    1637       tal:content="structure python:obj.Description()" 
    1738       tal:condition="obj/Description">Description</p> 
    1839    <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> 
    1944</div> 
    2045 
    2146<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"> 
    2549        <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> 
    2853    </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> 
    3058    <p class="simpleBlogDescription" 
    3159       tal:content="structure python:obj.Description()" 
    3260       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> 
    3365</div> 
    3466 
    3567<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"> 
    3970        <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> 
    4274    </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> 
    4483</div> 
    4584 
  • SimpleBlog/branches/plone-2.5/skins/SimpleBlog/blogentry_view.pt

    r589 r590  
    77    <tal:main-macro metal:define-macro="main"> 
    88        <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"/> 
    1011            <div metal:use-macro="here/document_actions/macros/document_actions"> 
    1112                Document actions (print, sendto etc) 
    1213            </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" /> 
    1723            <p class="documentDescription" 
    1824               tal:content="structure here/Description" 
     
    2026                Description 
    2127            </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> 
    2232            <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> 
    2341        </div> 
    2442        </tal:block> 
    2543    </tal:main-macro> 
    2644</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 
    2749</body> 
    2850</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>&nbsp;<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>&nbsp;<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>&nbsp;<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>&nbsp;<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">|&nbsp;</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>&nbsp;|&nbsp;<strong><a href="" 
     74            tal:attributes="href obj/absolute_url" 
     75            i18n:translate="permalink">Permalink</a></strong>&nbsp;|&nbsp;<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">&nbsp;|&nbsp;</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: &nbsp;<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">|&nbsp; 
     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 
    1103<div metal:define-macro="byline" class="documentByLine BlogByLine" 
    2104     tal:condition="python: site_properties.allowAnonymousViewAbout or not isAnon" 
    3105     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> 
    8106    <tal:name tal:condition="creator" 
    9107        tal:define="author python:mtool.getMemberInfo(creator)"> 
     
    23121    <span i18n:name="date" tal:replace="python:obj.toLocalizedTime(obj.simpleblog_tool.getEntryDate(obj), long_format=1)">Jun 2, 2002 2:42 pm</span> 
    24122    </span> 
    25        &mdash; 
    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        &mdash; 
     123    &mdash; 
     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    &mdash; 
    30128    <span tal:define="cats python:obj.EntryCategory(); 
    31129                       pss modules/Products.PythonScripts.standard;" 
     
    79177    August 16, 2001 at 23:35:59 
    80178    </span> 
    81        &mdash; 
     179    &mdash; 
    82180    <span class="state-expired" 
    83181        tal:condition="python:portal.isExpired(obj)" 
    84182        i18n:translate="time_expired"> 
    85183    expired 
    86        &mdash; 
     184    &mdash; 
    87185    </span> 
    88186    <span tal:define="cats python:obj.EntryCategory(); 
     
    112210    </div> 
    113211    </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  
    1313                  b_start request/b_start | b_start; 
    1414                  Batch python:modules['Products.CMFPlone'].Batch;"> 
     15        <tal:block metal:use-macro="here/SimpleBlog_macros/macros/blogGlobals"/> 
    1516        <div metal:use-macro="here/document_actions/macros/document_actions"> 
    1617            Document actions (print, sendto etc) 
     
    3536        </p> 
    3637        <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> 
    4343            <div metal:use-macro="here/batch_macros/macros/navigation" /> 
    4444        </div>