source: products/SimpleBlog/trunk/skins/SimpleBlog/portlet_simpleblog.pt @ 1

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

Building directory structure

  • Property svn:eol-style set to native
File size: 6.3 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    <div metal:define-macro="portlet" tal:omit-tag="">
8        <dl class="portlet" id="portlet-events"
9            tal:define="startpoint python:here.simpleblog_tool.getStartpointForSearch(here);
10                        inBlog python:startpoint.portal_type=='Blog';
11                        solo python:0">
12            <dt class="portletHeader"
13                tal:condition="inBlog">
14                    <a tal:attributes="href startpoint/absolute_url;
15                                       title startpoint/title_or_id"
16                       tal:content="startpoint/title_or_id"/>
17            </dt>
18            <dt class="portletHeader"
19                tal:condition="not: inBlog">
20                Blog
21            </dt>
22            <tal:calendar metal:use-macro="here/simpleblog_portlet_macros/macros/portletCalendar"/>
23            <tal:recent metal:use-macro="here/simpleblog_portlet_macros/macros/portletRecent"/>
24            <tal:categories metal:use-macro="here/simpleblog_portlet_macros/macros/portletCategories"/>
25        </dl>
26    </div>
27
28    <div metal:define-macro="portlet_no_calendar" tal:omit-tag="">
29        <dl class="portlet" id="portlet-events"
30            tal:define="startpoint python:here.simpleblog_tool.getStartpointForSearch(here);
31                        inBlog python:startpoint.portal_type=='Blog';
32                        solo python:0">
33            <dt class="portletHeader"
34                tal:condition="inBlog">
35                    <a tal:attributes="href startpoint/absolute_url;
36                                       title startpoint/title_or_id"
37                       tal:content="startpoint/title_or_id"/>
38            </dt>
39            <dt class="portletHeader"
40                tal:condition="not: inBlog">
41                Blog
42            </dt>
43            <tal:recent metal:use-macro="here/simpleblog_portlet_macros/macros/portletRecent"/>
44            <tal:categories metal:use-macro="here/simpleblog_portlet_macros/macros/portletCategories"/>
45        </dl>
46    </div>
47
48    <div metal:define-macro="portlet-recent" tal:omit-tag="">
49        <dl class="portlet" id="portlet-events"
50            tal:define="startpoint python:here.simpleblog_tool.getStartpointForSearch(here);
51                        inBlog python:startpoint.portal_type=='Blog';
52                        solo python:1">
53            <dt class="portletHeader"
54                tal:condition="inBlog">
55                    <a tal:attributes="href startpoint/absolute_url;
56                                       title startpoint/title_or_id"
57                       tal:content="startpoint/title_or_id"/>
58            </dt>
59            <dt class="portletHeader"
60                tal:condition="not: inBlog">
61                Blog
62            </dt>
63            <tal:recent metal:use-macro="here/simpleblog_portlet_macros/macros/portletRecent"/>
64        </dl>
65    </div>
66    <!-- portlet for in-context comments  -->
67    <div metal:define-macro="portlet-comments"
68         tal:omit-tag=""
69         tal:define="startpoint python:here.simpleblog_tool.getStartpointForSearch(here);
70                     inBlog python:startpoint.portal_type=='Blog'"
71         tal:condition="inBlog">
72         <div class="portlet"
73              tal:define="fpPath python:'/'.join(startpoint.getPhysicalPath());
74                          results python:here.portal_catalog.searchResults(
75                                   path=fpPath
76                                   , meta_type='Discussion Item'
77                                   , sort_on='created'
78                                   , sort_order='reverse'
79                                   , sort_limit=5);"
80              tal:condition="results">
81           <h5 i18n:translate="recent_comments">Recent Comments</h5>
82           <div class="portletBody">
83             <tal:block tal:repeat="item results">
84               <div class="portletContent odd"
85                    tal:attributes="class python:test(repeat['item'].index % 2, 'portletContent even', 'portletContent odd')">
86
87                 <tal:block tal:define="result_url item/getURL;
88                                   url string:$result_url/view;">
89                   <a href="#"
90                      tal:attributes="href url">
91                      <img src="#" height="16" width="16" alt=""
92                           tal:on-error="structure python:path('here/linkOpaque.gif')"
93                           tal:replace="structure python:path('here/%s' % item.getIcon)" /></a>&nbsp;<a
94                           href="#" tal:attributes="href url; title item/Description"
95                           tal:content="python:item.Title or item.getId" />
96                      <span class="discreet"
97                            tal:define="modificationDate item/ModificationDate;
98                                  modificationDate python:here.toLocalizedTime(modificationDate)"
99                            tal:content="string:(${item/Creator}) $modificationDate">
100                          creator   08/19/2001 03:01 AM </span>
101                </tal:block>
102             </div>
103           </tal:block>
104             <div class="portletContent odd">
105
106                 <a href="#"
107                    class="portletMore"
108                    i18n:translate="box_morelink"
109                    i18n:domain="plone"
110                    tal:attributes="href string:${startpoint/absolute_url}/search?path=${fpPath}&amp;meta_type=Discussion+Item&amp;sort_on=created&amp;sort_order=reverse;">
111                 More...</a>
112
113              </div>
114           </div>
115         </div>
116     </div>
117
118    <!-- old portlets for compatibility reasons -->
119    <div metal:define-macro="portletBlogFull_local" tal:omit-tag="">
120        <div metal:use-macro="here/portlet_simpleblog/macros/portlet"/>
121    </div>
122
123    <div metal:define-macro="portletBlogRecent_local" tal:omit-tag="">
124        <div metal:use-macro="here/portlet_simpleblog/macros/portlet-recent"/>
125    </div>
126
127    <div metal:define-macro="portletBlogFull_global" tal:omit-tag="">
128        <div metal:use-macro="here/portlet_simpleblog/macros/portlet"/>
129    </div>
130
131    <div metal:define-macro="portletBlogRecent_global" tal:omit-tag="">
132        <div metal:use-macro="here/portlet_simpleblog/macros/portlet-recent"/>
133    </div>
134
135</body>
136</html>
Note: See TracBrowser for help on using the repository browser.