[CMF-checkins] CVS: CMF - setup_talkback_tree.py:1.1 simple_metadata.pt:1.1 talkback_tree.pt:1.1 viewThreadsAtBottom.pt:1.1
andrew@digicool.com
andrew@digicool.com
Wed, 11 Jul 2001 16:18:17 -0400 (EDT)
Update of /cvs-repository/CMF/CMFDecor/skins/zpt_generic
In directory korak.digicool.com:/tmp/cvs-serv14700/zpt_generic
Added Files:
setup_talkback_tree.py simple_metadata.pt talkback_tree.pt
viewThreadsAtBottom.pt
Log Message:
*refactured discussion tree into zpt and python script for zpt
tree.
*converted additional skins to zpt.
*update viewThreadsAtBottom to use new zptified tree.
--- Added File setup_talkback_tree.py in package CMF ---
## Script (Python) "setup_talkback_tree"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=tree_root
##title=Standard Tree
##
from ZTUtils import SimpleTreeMaker
tm = SimpleTreeMaker('tb_tree')
def getKids(object):
return object.talkback.getReplies()
tm.setChildAccess(function=getKids)
tree, rows = tm.cookieTree(tree_root)
rows.pop(0)
return {'root': tree, 'rows': rows}
--- Added File simple_metadata.pt in package CMF ---
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
metal:use-macro="here/main_template/macros/master">
<body>
<div metal:fill-slot="main">
<div class="Desktop">
<dtml-if message>
<p>&dtml-message;</p>
<hr>
</dtml-if>
<div class="Metadata">
<h2>Resource Metadata </h2>
<div tal:define="effectiveString python:here.effective_date and here.effective_date.ISO() or 'None';
expirationString python: here.expiration_date and here.expiration_date.ISO() or 'None'">
<form action="editMetadata" method="post">
<table class="FormLayout">
<tr valign="top">
<th align="right">
<a href=""
tal:attributes="href python:here.portal_url() + '/metadata_help#Identifier'">Identifier</a>
</th>
<td colspan="3"
tal:content="here/Identifier">Identifier
</td>
</tr>
<tr valign="top">
<th align="right">
<a href=""
tal:attributes="href python: here.portal_url() + '/metadata_help#Title'">Title</a>
</th>
<td colspan="3">
<input type="text"
name="title"
value=""
size="65"
tal:attributes="value here/Title">
</td>
</tr>
<tr valign="top">
<th align="right">
<a href=""
tal:attributes="href python: here.portal_url() + '/metadata_help#Description'">Description</a>
</th>
<td colspan="3">
<textarea name="description:text" rows="5"
cols="65"
tal:content="here/Description">Description</textarea>
</td>
</tr>
<tr valign="top">
<th align="right">
<a href=""
tal:attributes="href python: here.portal_url() + '/metadata_help#Subject'">Subject</a>
</th>
<td>
<textarea name="subject:lines" rows="5"
cols="30"
tal:define="lines here/Subject"><span tal:repeat="line lines" tal:replace="line"></span></textarea>
</td>
</tr>
<tr valign="top">
<th align="right">
<a href=""
tal:attributes="href python: here.portal_url() + '/metadata_help#Creation Date'">Created</a>
</th>
<td tal:content="here/CreationDate">CreationDate
</td>
<th align="right">
<a href=""
tal:attributes="href python: here.portal_url() + '/metadata_help#ModifiedDate'">Modified</a>
</th>
<td tal:content="here/ModificationDate">ModificationDate
</td>
</tr>
<tr valign="top">
<th align="right">
<a href=""
tal:attributes="tal:attributes="href python: here.portal_url() + '/metadata_help#EffectiveDate'">Effective</a>
</th>
<td> <input type="text" name="effective_date"
value=""
tal:attributes="value effectiveString">
</td>
<th align="right">
<a href=""
tal:attributes="tal:attributes="href python: here.portal_url() + '/metadata_help#ExpirationDate'"> Expires </a>
</th>
<td> <input type="text" name="expiration_date"
value=""
tal:attributes="value expirationString">
</td>
</tr>
<tr valign="top">
<td> <br> </td>
<td>
<input type="submit" value=" Change ">
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
--- Added File talkback_tree.pt in package CMF ---
<html>
<head>
<title tal:content="template/title">The title</title>
</head>
<body tal:define="t python:here.setup_talkback_tree(here); height t/root/height">
<table cellspacing="0" border="0">
<tr tal:repeat="row t/rows">
<td tal:define="indent python:row.depth - 1"
tal:condition="indent"
tal:attributes="colspan indent" colspan="1"></td>
<td width="16" tal:define="rlink row/branch">
<a tal:condition="rlink"
tal:attributes="name row/id;href rlink/link"
tal:content="structure rlink/img" href name><img src="/p_/pl"></a>
</td>
<td tal:attributes="colspan python:height-row.depth"
tal:define="obj nocall:row/object;url python:obj.absolute_url()"
colspan="1" width="99%">
<a tal:attributes="href url">
<img tal:attributes="src python:obj.portal_url() + '/' + obj.getIcon()"
border="0" src="" /></a>
<a tal:attributes="href url"
tal:content="obj/Title" href="">Title</a>, by <span tal:replace="obj/Creator">Me</span> on <span tal:replace="obj/CreationDate">Today</span>
</td>
</tr>
</table>
</body>
</html>
--- Added File viewThreadsAtBottom.pt in package CMF ---
<div tal:condition="here/talkback">
<div tal:condition="python: here.talkback.hasReplies()">
<h4>Comments:</h4>
<span tal:replace="structure here/talkback_tree"></span>
</div>
</div>