[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Views/Browser - Contents.py:1.14 main.pt:1.15
runyaga
runyaga@thisbox.com
Tue, 3 Dec 2002 11:14:10 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv18273
Modified Files:
Contents.py main.pt
Log Message:
lots of work to just modify the time ;-).
ideally this formatTime will be moved and will
get its format from some service
=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py 1.13 => 1.14 ===
--- Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py:1.13 Tue Dec 3 09:32:38 2002
+++ Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py Tue Dec 3 11:14:09 2002
@@ -50,11 +50,11 @@
created = dc.created
if created is not None:
- info['created'] = created
+ info['created'] = formatTime(created)
modified = dc.modified
if modified is not None:
- info['modified'] = modified
+ info['modified'] = formatTime(modified)
return info
@@ -81,4 +81,11 @@
return ''
return self._index()
+
+def formatTime(in_date):
+ format='%m/%d/%Y'
+ undefined=u'N/A'
+ if hasattr(in_date, 'strftime'):
+ return in_date.strftime(format)
+ return undefined
=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/main.pt 1.14 => 1.15 ===
--- Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/main.pt:1.14 Tue Dec 3 09:32:38 2002
+++ Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/main.pt Tue Dec 3 11:14:09 2002
@@ -1,16 +1,6 @@
<html metal:use-macro="views/standard_macros/page">
<head>
<style metal:fill-slot="headers" type="text/css">
-<!--
-
-.ContentIcon {
- width: 20px;
-}
-
-.ContentTitle {
- text-align: left;
-}
--->
</style>
</head>
<body>
@@ -19,7 +9,8 @@
<div>Contents <a href="+"> Add... </a> </div>
<form name="containerContentsForm" method="get" action="."
- tal:define="container_contents view/listContentInfo"
+ tal:define="container_contents view/listContentInfo;
+ formatTime views/standard_macros/formatTime;"
tal:condition="container_contents"
>
@@ -68,7 +59,7 @@
</td>
<td><span tal:content="item/title|default"> </span></td>
<td><span tal:define="created item/created|default"
- tal:content="created"> </span></td>
+ tal:content="python:formatTime(created)"> </span></td>
<td><span tal:define="modified item/modified|default"
tal:content="modified"> </span></td>
</tr>