[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Views/Browser - Contents.py:1.7.2.2 index.pt:1.1.2.1 main.pt:1.10.2.1 remove_confirmed.pt:NONE
Jim Fulton
jim@zope.com
Fri, 4 Oct 2002 13:30:38 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv10951/lib/python/Zope/App/OFS/Container/Views/Browser
Modified Files:
Tag: ZopeDublinCore-branch
Contents.py index.pt main.pt
Removed Files:
Tag: ZopeDublinCore-branch
remove_confirmed.pt
Log Message:
Commiting branch prior to merge
=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py 1.7.2.1 => 1.7.2.2 ===
--- Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py:1.7.2.1 Thu Oct 3 18:16:50 2002
+++ Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py Fri Oct 4 13:30:07 2002
@@ -53,48 +53,36 @@
modified = dc.modified
if modified is not None:
- info['modified'] = created
+ info['modified'] = modified
return info
- def removeObjects(self, ids, REQUEST=None):
- """ """
+ def removeObjects(self, ids):
+ """Remove objects specified in a list of object ids"""
for id in ids:
- self.remove(id)
+ self._remove(id)
publishEvent(self.context, ObjectModifiedEvent(self.context))
- if REQUEST is not None:
- # for unit tests
- REQUEST.response.redirect(
- getView(self.context, "absolute_url", REQUEST)
- )
- return
- return self.confirmRemoved()
-
+ self.request.response.redirect('@@contents.html')
+
- def remove( self, name, silent=0 ):
+ def _remove(self, name):
"""
Remove the object stored under 'name', or raise a KeyError
- if no such object (pass non-zero 'silent' to suppress the
- exception).
+ if no such object.
"""
- try:
- content = ContextWrapper(self.context[name], self.context,
- name=name)
- del self.context[name]
- publishEvent(self.context, ObjectRemovedEvent(content))
- except KeyError:
- if not silent:
- raise
- return self.confirmRemoved( name=name )
+ content = ContextWrapper(self.context[name], self.context,
+ name=name)
+ del self.context[name]
+ publishEvent(self.context, ObjectRemovedEvent(content))
def listContentInfo(self):
return map(self._extractContentInfo, self.context.items())
contents = ViewPageTemplateFile('main.pt')
- confirmRemoved = ViewPageTemplateFile('remove_confirmed.pt')
+ contentsMacros = contents
_index = ViewPageTemplateFile('index.pt')
=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/index.pt 1.1 => 1.1.2.1 ===
--- Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/index.pt:1.1 Tue Oct 1 08:58:03 2002
+++ Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/index.pt Fri Oct 4 13:30:07 2002
@@ -16,14 +16,20 @@
<body>
<div metal:fill-slot="body">
- <table class="ContentListing">
-
- <tbody>
-
+ <table id="sortable" class="listing" summary="Content listing"
+ cellpadding="2" cellspacing="0" >
+
+ <thead>
<tr>
- <td class="ContentIcon"><br /> </td>
- <th class="ContentTitle">Title</th>
+ <th> </th>
+ <th>Name</th>
+ <th>Title</th>
+ <th>Created</th>
+ <th>Modified</th>
</tr>
+ </thead>
+
+ <tbody>
<tr tal:repeat="info view/listContentInfo">
@@ -38,9 +44,13 @@
<td class="ContentTitle">
<a href="subfolder_id"
tal:attributes="href info/url"
- tal:content="info/title"
- >Folder Title or ID here</a>
+ tal:content="info/id"
+ >ID here</a>
</td>
+
+ <td><span tal:content="info/title|default"> </span></td>
+ <td><span tal:content="info/created|default"> </span></td>
+ <td><span tal:content="info/modified|default"> </span></td>
</tr>
=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/main.pt 1.10 => 1.10.2.1 ===
--- Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/main.pt:1.10 Wed Oct 2 15:00:07 2002
+++ Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/main.pt Fri Oct 4 13:30:07 2002
@@ -16,71 +16,72 @@
<body>
<div metal:fill-slot="body">
-<form action="." method="get">
- <table class="ContentListing">
-
- <caption>Folder Contents <a href="+"> Add... </a> </caption>
-
- <tbody>
-
- <tr>
- <td class="ContentIcon"><br /> </td>
- <th class="ContentTitle">Title</th>
- </tr>
-
- <!--
- ** listContentInfo returns a sequence of mappings, containing:
- ** 'id' : the ID of the contained within the container
- ** 'url' : the absolute URL of the contained object
- ** 'title' : the title of the contained object
- ** 'icon' : the absolute URL of the icon, for the contained object
- (may be None)
- -->
- <tr tal:repeat="info view/listContentInfo">
-
- <td class="ContentSelect">
- <input type="checkbox" name="ids:list" value="id"
- tal:attributes="value info/id" />
- </td>
-
- <td>
- <a href="#"
- tal:attributes="href
- string:${info/url}/@@SelectedManagementView.html"
- tal:content="structure info/icon|default"
- >
- </a>
- </td>
-
- <td class="ContentTitle">
- <a href="subfolder_id"
- tal:attributes="href
- string:${info/url}/@@SelectedManagementView.html"
- tal:content="info/title"
- >Folder Title or ID here</a>
- </td>
-
- </tr>
-
- <tr tal:condition="nothing">
-
- <td class="ContentIcon">
- <img alt="Document" src="../../ZMI/www/document_icon.gif" />
- </td>
-
- <td class="ContentTitle">
- <a href="document_id">Document Title or ID here</a>
- </td>
-
- </tr>
- </tbody>
-
- </table>
- <br />
-
- <input type="submit" name="@@removeObjects.html:method" value="Delete"
- i18n:attributes="value string:menu_delete_button">
-</form>
+<div metal:define-macro="contents">
+
+ <div>Contents <a href="+"> Add... </a> </div>
+
+ <form name="containerContentsForm" method="get" action="."
+ tal:define="container_contents view/listContentInfo"
+ tal:condition="container_contents"
+ >
+
+ <table id="sortable" class="listing" summary="Content listing"
+ cellpadding="2" cellspacing="0" >
+
+ <thead>
+ <tr>
+ <th> </th>
+ <th> </th>
+ <th>Name</th>
+ <th>Title</th>
+ <th>Created</th>
+ <th>Modified</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+ <metal:block tal:repeat="item container_contents">
+ <tr tal:define="oddrow repeat/item/odd; url item/url"
+ tal:attributes="class python:oddrow and 'even' or 'odd'" >
+ <td>
+ <input type="checkbox" class="noborder" name="ids:list" id="#"
+ value="#"
+ tal:attributes="value item/id;
+ id python: 'cb_'+item['id'];
+ checked request/ids_checked|nothing;"/>
+ </td>
+ <td>
+ <a href="#"
+ tal:attributes="href
+ string:${url}/@@SelectedManagementView.html"
+ tal:content="structure item/icon|default"
+ >
+ </a>
+ </td>
+ <td>
+ <a href="#"
+ tal:attributes="href
+ string:${url}/@@SelectedManagementView.html"
+ tal:content="item/id"
+ >foo</a>
+ </td>
+ <td><span tal:content="item/title|default"> </span></td>
+ <td><span tal:content="item/created|default"> </span></td>
+ <td><span tal:content="item/modified|default"> </span></td>
+ </tr>
+ </metal:block>
+ </tbody>
+ </table>
+ <br />
+
+ <input type="submit" name="@@removeObjects.html:method" value="Delete"
+ tal:attributes="value string:menu_delete_button"
+ i18n:attributes="value" />
+
+ </form>
+
+</div>
</div>
</body>
=== Removed File Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/remove_confirmed.pt ===