Changeset 599

Show
Ignore:
Timestamp:
10/23/06 13:30:32
Author:
chervol
Message:

portlets updated

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • SimpleBlog/branches/plone-2.5/skins/SimpleBlog/portlet_simpleblog.pt

    r598 r599  
    22      xmlns:metal="http://xml.zope.org/namespaces/metal" 
    33      i18n:domain="SimpleBlog"> 
    4        
     4 
    55<body> 
    66 
     
    1010                        inBlog python:startpoint.portal_type=='Blog'; 
    1111                        solo python:0"> 
    12            
    1312            <dt class="portletHeader"  
    1413                tal:condition="inBlog"> 
     
    2120                Blog 
    2221            </dt> 
    23              
    2422            <tal:calendar metal:use-macro="here/simpleblog_portlet_macros/macros/portletCalendar"/> 
    2523            <tal:recent metal:use-macro="here/simpleblog_portlet_macros/macros/portletRecent"/> 
    2624            <tal:categories metal:use-macro="here/simpleblog_portlet_macros/macros/portletCategories"/> 
    2725        </dl> 
    28              
    2926    </div> 
    3027 
     
    3431                        inBlog python:startpoint.portal_type=='Blog'; 
    3532                        solo python:1"> 
    36            
    3733            <dt class="portletHeader"  
    3834                tal:condition="inBlog"> 
     
    4743            <tal:recent metal:use-macro="here/simpleblog_portlet_macros/macros/portletRecent"/> 
    4844        </dl> 
    49              
    5045    </div> 
    51      
    5246    <!-- portlet for in-context comments  --> 
    5347    <div metal:define-macro="portlet-comments" 
     
    6256                                   , meta_type='Discussion Item' 
    6357                                   , sort_on='created' 
    64                                    , sort_order='reverse')[:5];" 
     58                                   , sort_order='reverse' 
     59                                   , sort_limit=5);" 
    6560              tal:condition="results"> 
    6661           <h5 i18n:translate="recent_comments">Recent Comments</h5> 
     
    113108        <div metal:use-macro="here/portlet_simpleblog/macros/portlet"/> 
    114109    </div> 
    115       
     110 
    116111    <div metal:define-macro="portletBlogRecent_global" tal:omit-tag=""> 
    117112        <div metal:use-macro="here/portlet_simpleblog/macros/portlet-recent"/> 
  • SimpleBlog/branches/plone-2.5/skins/SimpleBlog/simpleblog_portlet_macros.pt

    r598 r599  
    33<div metal:define-macro="portletCategories"  
    44     tal:define="cats python:here.simpleblog_tool.getAvailableCategories(here, startpoint)" tal:omit-tag=""> 
    5      
    65    <tal:toggle tal:define="global toggle python:toggle or 0"/> 
    7  
    86    <tal:cats tal:repeat="cat python:here.simpleblog_tool.getSortedKeys(cats)"> 
    97        <dd class="" tal:define="oddrow repeat/cat/odd"  
     
    1210            <strong i18n:translate="blog_categories">Categories:</strong> 
    1311        </dd> 
    14         <dd class=""  
     12        <dd class="" 
     13            tal:condition="python:cats[cat]>0" 
    1514            tal:define="oddrow repeat/cat/odd; 
    1615                         pss modules/Products.PythonScripts.standard; 
    1716                         quotedCat python:pss.url_quote(cat)" 
    1817            tal:attributes="class python:test(toggle, 'portletItem even','portletItem odd')"> 
    19  
    20             <a tal:condition="python:cats[cat]>0"  href="#"  
    21                            tal:attributes="href string:${here/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}; 
    22                                            title cat"  
    23                            title="category"><span tal:content="cat"/></a> 
    24                         <span tal:condition="python:cats[cat]==0" tal:content="cat"/>  
     18            <a  href="#"  
     19                tal:attributes="href string:${startpoint/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}; 
     20                                title cat" title="category"><span tal:content="cat"/></a> 
    2521                        (<span tal:content="python:cats[cat]"/>) 
    26         </dd> 
    27         <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/> 
    28     </tal:cats> 
     22        </dd><tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/></tal:cats> 
    2923</div> 
    3024 
    3125<!-- macro used by the portlets to compile a list of recent additions --> 
    32 <div metal:define-macro="portletRecent"  
    33      tal:define="recent python:here.simpleblog_tool.collectEntries(startpoint);" 
    34      tal:omit-tag=""> 
    35  
    36     <tal:toggle tal:define="global toggle python:1"/> 
     26<div metal:define-macro="portletRecent"> 
     27     <tal:x tal:condition="maxItems|nothing"><tal:x tal:define="global maxResults maxItems"/> 
     28     </tal:x><tal:x tal:condition="not: maxItems|nothing"><tal:x tal:define="global maxResults python:0"/> 
     29     </tal:x><tal:block tal:define="maxResults python:test(maxResults==0,here.simpleblog_tool.getMaxItemsInPortlet(),maxResults);  
     30                                    recent python:startpoint.getEntries(maxResults=maxResults,skipOnTop=1, join=1); 
     31                                    global showIcons startpoint/getShowIcons;" 
     32     tal:omit-tag=""><tal:toggle tal:define="global toggle python:1"/> 
    3733    <tal:entries tal:repeat="entry recent"> 
     34        <tal:start tal:condition="python:inBlog and not solo"> 
    3835        <dd class="" tal:define="oddrow repeat/entry/odd"  
    3936                     tal:condition="repeat/entry/start"  
    4037                     tal:attributes="class python:test(toggle, 'portletItem odd','portletItem even')"> 
    4138            <tal:frontpage> 
    42                 <a tal:condition="python:inBlog" href="#" tal:attributes="href startpoint/absolute_url;title startpoint/title_or_id" title=""><strong><span tal:replace="startpoint/title_or_id"/>:</strong></a> 
    43                 <strong tal:condition="python:not inBlog" i18n:translate="recent_additions">Recent additions:</strong> 
     39                <strong i18n:translate="recent_additions">Recent entries:</strong> 
    4440            </tal:frontpage> 
    45         </dd> 
    46          
    47         <dd class=""  
     41        </dd></tal:start> 
     42        <dd class="" 
    4843            tal:define="oddrow repeat/entry/odd; 
    49                                                item_type entry/portal_type; 
    50                                                item_type_class python:'contenttype-' + normalizeString(item_type);"  
     44                        item_type entry/portal_type; 
     45                        item_type_class python:'contenttype-' + normalizeString(item_type);"  
    5146            tal:attributes="class python:test(toggle, 'portletItem even','portletItem odd')"> 
    5247            <a href="#"  
    5348               tal:attributes="href entry/absolute_url;"  
    5449                               title="entry"> 
    55                            <span tal:attributes="class string:simpleBlogPortletIcons ${item_type_class}" tal:content="entry/title_or_id"/> 
    56             </a> 
    57             <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/>         
    58              
     50               <span tal:attributes="class python:showIcons and 'simpleBlogPortletIcons '+item_type_class or ''" tal:content="entry/title_or_id"/> 
     51            </a><tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/> 
    5952        </dd> 
    60         <dd class=""  
     53        <dd class="" 
    6154            tal:define="oddrow repeat/entry/odd; 
    6255                        solo solo|python:0; 
     
    6457            tal:condition="repeat/entry/end"  
    6558            tal:attributes="class python:test(toggle, className + ' even', className + ' odd')"> 
    66             <a href="#" tal:attributes="href string:${here/absolute_url}/SimpleBlogFullSearch"  
     59            <a href="#" tal:attributes="href string:${startpoint/absolute_url}/SimpleBlogFullSearch"  
    6760                           title="more..." 
    6861                           i18n:attributes="title box_morelink" 
    6962                           i18n:translate="box_morelink" 
    7063                           i18n:domain="plone">More...</a> 
    71         </dd> 
    72     </tal:entries> 
    73      
     64        </dd></tal:entries> 
    7465    <tal:no-items tal:condition="not: recent"> 
    7566        <dd class="portletItem even"> 
     
    7970            <span i18n:translate="no_published_blog_entries">No blog entries are published.</span> 
    8071            <tal:toggle tal:define="global toggle python:0"/> 
    81         </dd> 
    82     </tal:no-items> 
     72        </dd></tal:no-items></tal:block> 
    8373</div> 
    8474 
     
    163153                              tal:omit-tag="" 
    164154                     ><a href="" 
    165                          tal:attributes="href python:here.absolute_url()+'/SimpleBlogDaySearch?startdate:date=%s'%(end); 
     155                         tal:attributes="href python:startpoint.absolute_url()+'/SimpleBlogDaySearch?startdate:date=%s'%(end); 
    166156                                         title python:'\n'.join([toLocalizedTime(cur_date)]+[getEventString(e) for e in day['eventslist']]);" 
    167157                         tal:content="python:int_daynumber or default">