source: products/SimpleBlog/branches/plone-2.0.5-Blogging-APIs/skins/SimpleBlog/portlet_simpleblog.pt

Last change on this file was 1, checked in by myroslav, 18 years ago

Building directory structure

File size: 5.1 KB
Line 
1<html xmlns:tal="http://xml.zope.org/namespaces/tal"
2      xmlns:metal="http://xml.zope.org/namespaces/metal"
3      i18n:domain="SimpleBlog">
4     
5<body>
6
7        <!-- local portlets, they will only show up inside a SimpleBlog -->
8    <div metal:define-macro="portletBlogFull_local" tal:omit-tag="">
9            <!-- not the best way to do this but I have no idea how to fill the css_slot for this case where
10                       the portlet is not in one of simpleblog's templates -->
11            <!--link rel="stylesheet" type="text/css" media="screen" href=""
12                  tal:attributes="href string:$portal_url/SimpleBlogCSS.css" /-->
13                <div class="portlet"
14                     tal:define="fp python:here.simpleblog_tool.getFrontPage(here)"
15                     tal:condition="python:fp!=None">
16                <h5>
17                    <a tal:attributes="href fp/absolute_url;
18                                       title fp/title_or_id"
19                       tal:content="fp/title_or_id"/>
20                </h5>
21                        <div class="portletBody">
22                        <div metal:use-macro="here/SimpleBlog_macros/macros/portletCalendar"/>
23                                <div metal:use-macro="here/SimpleBlog_macros/macros/portletRecent"/>
24                                <div metal:use-macro="here/SimpleBlog_macros/macros/portletCategories"/>
25                        </div>
26                </div>   
27    </div>
28
29    <div metal:define-macro="portletBlogRecent_local" tal:omit-tag="">
30                <div class="portlet" tal:condition="python: here.meta_type in ['Blog', 'BlogEntry', 'BlogFolder']">
31                <h5>Blog</h5>
32                        <div class="portletBody">
33                                <div metal:use-macro="here/SimpleBlog_macros/macros/portletRecent"/>
34                        </div>
35                </div>   
36    </div>
37
38    <div metal:define-macro="portletRecentComments_local"
39         tal:omit-tag=""
40         tal:define="fp python:here.simpleblog_tool.getFrontPage(here);"
41         tal:condition="python:fp!=None">
42         <div class="portlet"
43              tal:define="fpPath python:'/'.join(fp.getPhysicalPath());
44                          results python:here.portal_catalog.searchResults(path=fpPath, meta_type='Discussion Item', sort_on='created', sort_order='reverse')[:5];"
45              tal:condition="results">
46           <h5 i18n:translate="recent_comments">Recent Comments</h5>
47           <div class="portletBody">
48             <tal:block tal:repeat="item results">
49               <div class="portletContent odd"
50                    tal:attributes="class python:test(repeat['item'].index % 2, 'portletContent even', 'portletContent odd')">
51
52                 <tal:block tal:define="result_url item/getURL;
53                                   url string:$result_url/view;">
54                   <a href="#"
55                      tal:attributes="href url">
56                      <img src="#" height="16" width="16" alt=""
57                           tal:on-error="structure python:path('here/linkOpaque.gif')"
58                           tal:replace="structure python:path('here/%s' % item.getIcon)" /></a>&nbsp;<a
59                           href="#" tal:attributes="href url; title item/Description"
60                           tal:content="python:item.Title or item.getId" />
61                      <span class="discreet"
62                            tal:define="modificationDate item/ModificationDate;
63                                  modificationDate python:here.toPortalTime(modificationDate)"
64                            tal:content="string:(${item/Creator}) $modificationDate">
65                          creator   08/19/2001 03:01 AM </span>
66                </tal:block>
67             </div>
68           </tal:block>
69             <div class="portletContent odd">
70
71                 <a href="#"
72                    class="portletMore"
73                    i18n:translate="box_morelink"
74                    i18n:domain="plone"
75                    tal:attributes="href string:${fp/absolute_url}/search?path=${fpPath}&amp;meta_type=Discussion+Item&amp;sort_on=created&amp;sort_order=reverse;">
76                 More...</a>
77
78              </div>
79           </div>
80         </div>
81     </div>
82
83
84        <!-- global portlets, similar as above but this version show up everywhere -->
85    <div metal:define-macro="portletBlogFull_global" tal:omit-tag="">
86            <!-- not the best way to do this but I have no idea how to fill the css_slot for this case where
87                       the portlet is not in one of simpleblog's templates -->
88            <link rel="stylesheet" type="text/css" media="screen" href="" tal:attributes="href string:$portal_url/SimpleBlogCSS.css" />
89                <div class="portlet">
90                <h5>Blog</h5>
91                        <div class="portletBody">
92                            <div metal:use-macro="here/SimpleBlog_macros/macros/portletCalendar"/>
93                                <div metal:use-macro="here/SimpleBlog_macros/macros/portletRecent"/>
94                                <div metal:use-macro="here/SimpleBlog_macros/macros/portletCategories"/>
95                        </div>
96                </div>   
97    </div>
98     
99    <div metal:define-macro="portletBlogRecent_global" tal:omit-tag="">
100                <div class="portlet">
101                <h5>Blog</h5>
102                        <div class="portletBody">
103                                <div metal:use-macro="here/SimpleBlog_macros/macros/portletRecent"/>
104                        </div>
105                </div>   
106    </div>
107</body>
108</html>
Note: See TracBrowser for help on using the repository browser.