[CMF-checkins] CVS: CMF/CMFDefault/skins/zpt_generic - index_html_utils.html:1.1.2.1 index_html.pt:1.5.4.3
Tres Seaver
tseaver@zope.com
Thu, 25 Jul 2002 10:25:53 -0400
Update of /cvs-repository/CMF/CMFDefault/skins/zpt_generic
In directory cvs.zope.org:/tmp/cvs-serv25527/CMFDefault/skins/zpt_generic
Modified Files:
Tag: CMF-1_3-branch
index_html.pt
Added Files:
Tag: CMF-1_3-branch
index_html_utils.html
Log Message:
- Refactor index_html's content display into reusable macros, use in
new 'folder_view' template.
=== Added File CMF/CMFDefault/skins/zpt_generic/index_html_utils.html ===
<div metal:define-macro="index_header">
<h1 id="DesktopTitle"
tal:content="here/Title">Document Title</h1>
<div id="DesktopDescription" tal:content="here/Description">
Document Description goes here.
</div>
</div>
<div metal:define-macro="index_content">
<div tal:define="auth_filter nocall: modules/ZTUtils/LazyFilter;
default_types python:( 'Document'
, 'Image'
, 'File'
, 'FAQ'
, 'News Item'
);
types types | here/show_content_types | default_types;
raw_items python: here.contentValues(
filter={'portal_type': types } );
items python: auth_filter( raw_items, skip='View' );
">
<div tal:condition="items">
<h4> Content </h4>
<ul>
<li tal:repeat="item items">
<a href="item_url" tal:attributes="href item/absolute_url"><img
align="middle" border="0"
tal:attributes="src string:${item/portal_url}/${item/getIcon};
alt string:${item/Type};
title string:${item/Type}"></a>
<a href="item_url" tal:attributes="href item/absolute_url"
tal:content="item/Title"> Title </a>
<blockquote tal:condition="exists: item/Description"
tal:content="item/Description">
Description <!--fmt="structured-text'-->
</blockquote>
</li>
</ul>
</div>
</div>
</div>
<div metal:define-macro="index_links">
<div tal:define="auth_filter nocall: modules/ZTUtils/LazyFilter;
default_types python:( 'Link'
, 'Favorite'
, 'Topic'
);
types types | here/show_link_types | default_types;
raw_items python: here.contentValues(
filter={ 'portal_type': types } );
items python: auth_filter( raw_items, skip='View' );
">
<div tal:condition="items">
<h4> Related Resources </h4>
<ul>
<li tal:repeat="item items">
<a href="item_url" tal:attributes="href item/absolute_url"><img
align="middle" border="0"
tal:attributes="src string:${item/portal_url}/${item/getIcon};
alt string:${item/Type};
title string:${item/Type}"></a>
<a href="item_url" tal:attributes="href item/absolute_url"
tal:content="item/Title"> Title </a>
<blockquote tal:condition="exists: item/Description"
tal:content="item/Description">
Description <!--fmt="structured-text'-->
</blockquote>
</li>
</ul>
</div>
</div>
</div>
<div metal:define-macro="index_folders">
<div tal:define="auth_filter nocall: modules/ZTUtils/LazyFilter;
default_types python:( 'Folder'
,
);
types types | here/show_folder_types | default_types;
raw_items python: here.contentValues(
filter={ 'portal_type': types } );
items python: auth_filter( raw_items, skip='View' );
">
<div tal:condition="items">
<h4> Folders </h4>
<ul>
<li tal:repeat="item items">
<a href="item_url" tal:attributes="href item/absolute_url"><img
align="middle" border="0"
tal:attributes="src string:${item/portal_url}/${item/getIcon};
alt string:${item/Type};
title string:${item/Type}"></a>
<a href="item_url" tal:attributes="href item/absolute_url"
tal:content="item/TitleOrId"> Title </a>
<blockquote tal:condition="exists: item/Description"
tal:content="item/Description">
Description <!--fmt="structured-text'-->
</blockquote>
</li>
</ul>
</div>
</div>
</div>
<div metal:define-macro="news_box">
<table class="NewsItems"
cellspacing="0"
cellpadding="0"
border="0"
width="100%">
<tbody tal:define="news python: here.portal_catalog( meta_type='News Item'
, sort_on='Date'
, sort_order='reverse'
, review_state='published'
);
Batch python:modules['ZTUtils'].Batch;
global batch python:Batch(news, 10, 0, orphan=1)">
<tr>
<td class="NewsBorder" width="1" rowspan="13" bgcolor="#6699CC">
<img src="spacer.gif" alt=" " width="1" height="2" border="0">
</td>
<td valign="top" class="NewsTitle" width="100%">
<b>News</b>
</td>
</tr>
<tr class="NewsItemRow" tal:condition="news"
tal:repeat="news batch">
<td valign="top" wrap>
<a href="" tal:attributes="href python:news.getURL()"
tal:content="news/Title"></a><br>
<span tal:replace="news/Date">Date</span>
</td>
</tr>
<tr class="NewsItemRow" tal:condition="python:not(news)">
<td valign="top">
No news is no news.
</td>
</tr>
<tr class="NewsItemRow">
<td>
<a href="recent_news">More...</a>
</td>
</tr>
</tbody>
</table>
</div>
=== CMF/CMFDefault/skins/zpt_generic/index_html.pt 1.5.4.2 => 1.5.4.3 ===
<html metal:use-macro="here/main_template/macros/master" >
-<body>
+<body style="position: relative">
<div metal:fill-slot="header"
- tal:define="global has_local python: 'local_html' in here.objectIds()"
+ tal:define="global has_local python: 'local_pt' in here.objectIds()"
>
-
<div tal:condition="not: has_local">
-
- <h1 id="DesktopTitle"
- tal:content="here/Title">Document Title</h1>
-
- <div id="DesktopDescription" tal:content="here/Description">
- Document Description goes here.
- </div>
-
+ <div metal:use-macro="here/index_html_utils/macros/index_header" />
</div>
<div tal:condition="has_local">
- <div metal:use-macro="here/local_html/macros/header|default">
- 'local_html' body goes here.
+ <div metal:use-macro="here/local_pt/macros/header|default">
+ 'local_pt' body goes here.
</div>
</div>
</div><!-- header slot -->
- <div metal:fill-slot="main"
- >
+ <div metal:fill-slot="main">
- <div tal:condition="not: has_local"
- tal:define="auth_filter nocall: modules/ZTUtils/LazyFilter"
- >
+<div id="content_well"
+ style="float: left; top: 0; width: 80%;">
+<br />
- <div tal:define="raw_items python: here.contentValues(
- filter={'portal_type':( 'Document'
- , 'Image'
- , 'File'
- , 'News Item'
- ) } );
- items python: auth_filter( raw_items, skip='View' );
- ">
- <div tal:condition="items">
-
- <h4> Documents, Images, Files, and News Items </h4>
-
- <ul>
- <li tal:repeat="item items">
- <a href="item_url" tal:attributes="href item/absolute_url"><img
- align="middle" border="0"
- tal:attributes="src string:${item/portal_url}/${item/getIcon};
- alt string:${item/Type};
- title string:${item/Type}"></a>
- <a href="item_url" tal:attributes="href item/absolute_url"
- tal:content="item/Title"> Title </a>
- <blockquote tal:condition="exists: item/Description"
- tal:content="item/Description">
- Description <!--fmt="structured-text'-->
- </blockquote>
- </li>
- </ul>
-
- </div>
- </div>
+ <div tal:condition="not: has_local" >
+ <div metal:use-macro="here/index_html_utils/macros/index_content" />
- <div tal:define="raw_items python: here.contentValues(
- filter={'portal_type':( 'Link'
- , 'Favorite'
- , 'Topic'
- ) } );
- items python: auth_filter( raw_items, skip='View' );
- ">
- <div tal:condition="items">
- <h4> Related Resources </h4>
-
- <ul>
- <li tal:repeat="item items">
- <a href="item_url" tal:attributes="href item/absolute_url"><img
- align="middle" border="0"
- tal:attributes="src string:${item/portal_url}/${item/getIcon};
- alt string:${item/Type};
- title string:${item/Type}"></a>
- <a href="item_url" tal:attributes="href item/absolute_url"
- tal:content="item/Title"> Title </a>
- <blockquote tal:condition="exists: item/Description"
- tal:content="item/Description">
- Description <!--fmt="structured-text'-->
- </blockquote>
- </li>
- </ul>
+ <div metal:use-macro="here/index_html_utils/macros/index_links" />
- </div>
- </div>
-
-
- <div tal:define="raw_items python: here.contentValues(
- filter={ 'portal_type': 'Folder' } );
- items python: auth_filter( raw_items, skip='View' );
- ">
- <div tal:condition="items">
- <h4> Folders </h4>
-
- <ul>
- <li tal:repeat="item items">
- <a href="item_url" tal:attributes="href item/absolute_url"><img
- align="middle" border="0"
- tal:attributes="src string:${item/portal_url}/${item/getIcon};
- alt string:${item/Type};
- title string:${item/Type}"></a>
- <a href="item_url" tal:attributes="href item/absolute_url"
- tal:content="item/TitleOrId"> Title </a>
- <blockquote tal:condition="exists: item/Description"
- tal:content="item/Description">
- Description <!--fmt="structured-text'-->
- </blockquote>
- </li>
- </ul>
-
- </div>
- </div>
+ <div metal:use-macro="here/index_html_utils/macros/index_folders" />
</div><!-- not: has_local -->
<div tal:condition="has_local">
- <div metal:use-macro="here/local_html/macros/body|default">
- 'local_html' body goes here.
+ <div metal:use-macro="here/local_pt/macros/body|default">
+ 'local_pt' body goes here.
</div>
</div>
+
+</div>
+
+<div style="width: 20%">
+<div metal:use-macro="here/index_html_utils/macros/news_box" />
+</div>
+
</div><!-- main slot -->
+
</body>
</html>
+