source: products/SimpleBlog/branches/optimizations/skins/SimpleBlog/portlet_simpleblog.pt

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

Building directory structure

  • Property svn:eol-style set to native
File size: 5.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-recent" 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:1">
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        </dl>
45    </div>
46    <!-- portlet for in-context comments  -->
47    <div metal:define-macro="portlet-comments"
48         tal:omit-tag=""
49         tal:define="startpoint python:here.simpleblog_tool.getStartpointForSearch(here);
50                     inBlog python:startpoint.portal_type=='Blog'"
51         tal:condition="inBlog">
52         <div class="portlet"
53              tal:define="fpPath python:'/'.join(startpoint.getPhysicalPath());
54                          results python:here.portal_catalog.searchResults(
55                                   path=fpPath
56                                   , meta_type='Discussion Item'
57                                   , sort_on='created'
58                                   , sort_order='reverse'
59                                   , sort_limit=5);"
60              tal:condition="results">
61           <h5 i18n:translate="recent_comments">Recent Comments</h5>
62           <div class="portletBody">
63             <tal:block tal:repeat="item results">
64               <div class="portletContent odd"
65                    tal:attributes="class python:test(repeat['item'].index % 2, 'portletContent even', 'portletContent odd')">
66
67                 <tal:block tal:define="result_url item/getURL;
68                                   url string:$result_url/view;">
69                   <a href="#"
70                      tal:attributes="href url">
71                      <img src="#" height="16" width="16" alt=""
72                           tal:on-error="structure python:path('here/linkOpaque.gif')"
73                           tal:replace="structure python:path('here/%s' % item.getIcon)" /></a>&nbsp;<a
74                           href="#" tal:attributes="href url; title item/Description"
75                           tal:content="python:item.Title or item.getId" />
76                      <span class="discreet"
77                            tal:define="modificationDate item/ModificationDate;
78                                  modificationDate python:here.toLocalizedTime(modificationDate)"
79                            tal:content="string:(${item/Creator}) $modificationDate">
80                          creator   08/19/2001 03:01 AM </span>
81                </tal:block>
82             </div>
83           </tal:block>
84             <div class="portletContent odd">
85
86                 <a href="#"
87                    class="portletMore"
88                    i18n:translate="box_morelink"
89                    i18n:domain="plone"
90                    tal:attributes="href string:${startpoint/absolute_url}/search?path=${fpPath}&amp;meta_type=Discussion+Item&amp;sort_on=created&amp;sort_order=reverse;">
91                 More...</a>
92
93              </div>
94           </div>
95         </div>
96     </div>
97
98    <!-- old portlets for compatibility reasons -->
99    <div metal:define-macro="portletBlogFull_local" tal:omit-tag="">
100        <div metal:use-macro="here/portlet_simpleblog/macros/portlet"/>
101    </div>
102
103    <div metal:define-macro="portletBlogRecent_local" tal:omit-tag="">
104        <div metal:use-macro="here/portlet_simpleblog/macros/portlet-recent"/>
105    </div>
106
107    <div metal:define-macro="portletBlogFull_global" tal:omit-tag="">
108        <div metal:use-macro="here/portlet_simpleblog/macros/portlet"/>
109    </div>
110
111    <div metal:define-macro="portletBlogRecent_global" tal:omit-tag="">
112        <div metal:use-macro="here/portlet_simpleblog/macros/portlet-recent"/>
113    </div>
114
115</body>
116</html>
Note: See TracBrowser for help on using the repository browser.