[42] | 1 | <html xmlns:tal="http://xml.zope.org/namespaces/tal" |
---|
| 2 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
---|
| 3 | i18n:domain="plone"> |
---|
| 4 | <body> |
---|
| 5 | <div metal:define-macro="portlet" |
---|
| 6 | tal:define="results python:request.get('news', |
---|
| 7 | here.portal_catalog.searchResults(portal_type='News Item', |
---|
| 8 | sort_on='Date', |
---|
| 9 | sort_order='reverse', |
---|
| 10 | review_state='published (Public)')[:5]);" |
---|
| 11 | tal:condition="python:test(template.getId()!='news' and results, 1, 0)"> |
---|
| 12 | |
---|
| 13 | <dl class="portlet" id="portlet-news"> |
---|
| 14 | |
---|
| 15 | <dt class="portletHeader"> |
---|
| 16 | <a href="#" |
---|
| 17 | tal:condition="python:'news' in portal.contentIds()" |
---|
| 18 | tal:attributes="href string:${utool}/news" |
---|
| 19 | i18n:translate="box_news">News</a> |
---|
| 20 | <a href="#" |
---|
| 21 | tal:condition="python:'news' not in portal.contentIds()" |
---|
| 22 | tal:attributes="href string:${utool}/news_listing" |
---|
| 23 | i18n:translate="box_news">News</a> |
---|
| 24 | </dt> |
---|
| 25 | |
---|
| 26 | <tal:newsitems tal:repeat="obj results"> |
---|
| 27 | <dd tal:define="oddrow repeat/obj/odd" |
---|
| 28 | tal:attributes="class python:test(oddrow, 'portletItem even', 'portletItem odd')"> |
---|
| 29 | |
---|
| 30 | <a href="" |
---|
| 31 | tal:attributes="href obj/getURL; |
---|
| 32 | title obj/Description"> |
---|
| 33 | <tal:block replace="structure here/newsitem_icon.gif"/> |
---|
| 34 | <span tal:replace="obj/pretty_title_or_id"> |
---|
| 35 | Plone 2.1 announced! |
---|
| 36 | </span> |
---|
| 37 | <span class="portletItemDetails" |
---|
| 38 | tal:content="python:here.toLocalizedTime(obj.Date)">May 5</span> |
---|
| 39 | </a> |
---|
| 40 | </dd> |
---|
| 41 | </tal:newsitems> |
---|
| 42 | |
---|
| 43 | <dd class="portletFooter"> |
---|
| 44 | |
---|
| 45 | <a href="" |
---|
| 46 | tal:condition="python:'news' in portal.contentIds()" |
---|
| 47 | tal:attributes="href string:${utool}/news" |
---|
| 48 | i18n:translate="box_more_news_link" |
---|
| 49 | > |
---|
| 50 | More news… |
---|
| 51 | </a> |
---|
| 52 | |
---|
| 53 | <a href="" |
---|
| 54 | tal:condition="python:'news' not in portal.contentIds()" |
---|
| 55 | tal:attributes="href string:${utool}/news_listing" |
---|
| 56 | i18n:translate="box_more_news_link" |
---|
| 57 | > |
---|
| 58 | More news… |
---|
| 59 | </a> |
---|
| 60 | </dd> |
---|
| 61 | </dl> |
---|
| 62 | |
---|
| 63 | </div> |
---|
| 64 | </body> |
---|
| 65 | </html> |
---|