[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container - contents.pt:1.4 contents.py:1.23

Jim Fulton jim@zope.com
Wed, 18 Jun 2003 12:04:03 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/container
In directory cvs.zope.org:/tmp/cvs-serv17617/src/zope/app/browser/container

Modified Files:
	contents.pt contents.py 
Log Message:
Fixed collector entry 169

==============================================================
= Request - Entry #1 by Anonymous User on Jun 18, 2003 1:07 am

Go to a folder, check NO boxes and press the "Rename" button.

The view does not detect the lack of items checked (i.e. nothing to be
renamed) and goes in "rename mode".

This means only the "Apply" and "Canel" buttons are visible (until
such time as one or these buttons is pressed and normality returns)
==============================================================

Also:

- The error message was not being displayed.

- The error wasn't being displayed with a distinctive style.

- Removed unused contents_table macro.


=== Zope3/src/zope/app/browser/container/contents.pt 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/container/contents.pt:1.3	Thu Jun 12 12:35:12 2003
+++ Zope3/src/zope/app/browser/container/contents.pt	Wed Jun 18 12:03:32 2003
@@ -7,10 +7,10 @@
 <div metal:fill-slot="body">
 <div metal:define-macro="contents">
 
-  <p tal:condition="view/error" tal:content="view/error">Error message</p>
-
   <form name="containerContentsForm" method="POST" action="."
-        tal:attributes="action request/URL">
+        tal:attributes="action request/URL"
+        tal:define="container_contents view/listContentInfo"
+        >
 
       <input type="hidden" name="type_name" value=""
              tal:attributes="value request/type_name"
@@ -21,10 +21,13 @@
              tal:condition="request/retitle_id|nothing"
              />
 
-      <table id="sortable" class="listing" summary="Content listing"
-             metal:define-macro="contents_table"
-             tal:define="container_contents view/listContentInfo"
-             >
+      <div class="page_error"
+           tal:condition="view/error" 
+           tal:content="view/error">
+        Error message
+      </div>
+
+      <table id="sortable" class="listing" summary="Content listing">
     
         <thead> 
           <tr>


=== Zope3/src/zope/app/browser/container/contents.py 1.22 => 1.23 ===
--- Zope3/src/zope/app/browser/container/contents.py:1.22	Thu Jun 12 12:35:12 2003
+++ Zope3/src/zope/app/browser/container/contents.py	Wed Jun 18 12:03:32 2003
@@ -56,6 +56,9 @@
 
             return self._normalListContentsInfo()
 
+        elif "container_rename_button" in request and not request.get("ids"):
+            self.error = _("You didn't specify any ids to rename.")
+
         elif "type_name" in request and "new_value" in request:
             self.addObject()
         elif "rename_ids" in request and "new_value" in request:
@@ -88,7 +91,8 @@
         self.specialButtons = (
                  'type_name' in request or
                  'rename_ids' in request or
-                 'container_rename_button' in request or
+                 ('container_rename_button' in request
+                  and request.get("ids")) or
                  'retitle_id' in request
                  )
         self.normalButtons = not self.specialButtons
@@ -211,7 +215,7 @@
         request = self.request
         ids = request.get('ids')
         if not ids:
-            self.error = _("You didn't specify any ids to rename.")
+            self.error = _("You didn't specify any ids to remove.")
             return
                  
         container = zapi.getAdapter(self.context, IZopeContainer)