[Zope-CVS] CVS: Products/PageDesign/www - addElementDialog.pt:1.1.2.3 movedown.gif:1.1.2.2 moveup.gif:1.1.2.2 object_list_rows.pt:1.1.2.3

Shane Hathaway shane@cvs.zope.org
Sat, 10 Aug 2002 11:11:12 -0400


Update of /cvs-repository/Products/PageDesign/www
In directory cvs.zope.org:/tmp/cvs-serv10510/www

Modified Files:
      Tag: page-redesign-branch
	addElementDialog.pt movedown.gif moveup.gif 
	object_list_rows.pt 
Log Message:
Added object icons, turned the add element dialog into a simple file chooser,
and in the process made it so page designs don't have to be aware of
palettes at all.  This is a good thing. ;-)


=== Products/PageDesign/www/addElementDialog.pt 1.1.2.2 => 1.1.2.3 ===
--- Products/PageDesign/www/addElementDialog.pt:1.1.2.2	Thu Aug  8 22:58:46 2002
+++ Products/PageDesign/www/addElementDialog.pt	Sat Aug 10 11:11:11 2002
@@ -2,39 +2,32 @@
 <head>
 <title>Add page element</title>
 </head>
-<body tal:define="palette_id python:
-  request.get('palette_id') or here.getDefaultPaletteId()">
-<form name="choose_palette" action="addElementDialog" method="GET">
+<body tal:define="source_path python:
+  request.get('source_path') or '/'.join(here.aq_parent.getPhysicalPath())">
+<form action="addElementDialog" method="GET">
 <input type="hidden" name="target_path"
-       tal:attributes="value request/target_path" />
-Palette:
-<select name="palette_id" onchange="submit.click()">
-<option></option>
-<option tal:repeat="id here/getPaletteIds" tal:content="id"
-  tal:attributes="value id; selected python: id == palette_id">Default</option>
+  tal:attributes="value request/target_path" />
+Folder:
+<select name="source_path" onchange="go.click()"
+  tal:define="parent_paths python: here.computeParentPaths(source_path)">
+<option tal:content="source_path"
+  tal:attributes="value source_path">/a/b/c</option>
+<option tal:repeat="parent_path parent_paths" tal:content="parent_path"
+  tal:attributes="value parent_path">/site/folder/stuff</option>
 </select>
-<input type="submit" value="Change palette" name="submit" />
+<input type="submit" value="Go" name="go" />
 </form>
 
-<hr />
-
-<div tal:define="items python: palette_id and
-  here.getPaletteContents(palette_id, request) or ()">
+<div tal:define="folder python: here.restrictedTraverse(source_path);
+  items python: here.getFolderContentsInfo(folder, request)">
 <form action="addElements" tal:condition="items">
 <table>
 <tbody metal:use-macro="here/object_list_rows/macros/tbody" />
 </table>
 <input type="hidden" name="target_path"
-       tal:attributes="value request/target_path" />
-<input type="submit" value="Add elements" name="submit"
-       onclick="" />
+  tal:attributes="value request/target_path" />
+<input type="submit" value="Add elements" name="submit" />
 </form>
-<em tal:condition="not:palette_id">
-  Please choose a palette.
-</em>
-<em tal:condition="python: palette_id and not items">
-  No page elements are in this palette.
-</em>
 </div>
 
 </body>


=== Products/PageDesign/www/movedown.gif 1.1.2.1 => 1.1.2.2 ===


=== Products/PageDesign/www/moveup.gif 1.1.2.1 => 1.1.2.2 ===


=== Products/PageDesign/www/object_list_rows.pt 1.1.2.2 => 1.1.2.3 ===
--- Products/PageDesign/www/object_list_rows.pt:1.1.2.2	Fri Aug  9 23:33:41 2002
+++ Products/PageDesign/www/object_list_rows.pt	Sat Aug 10 11:11:11 2002
@@ -2,47 +2,71 @@
 
 <table>
 <tbody metal:define-macro="tbody"
-       tal:define="my_url python: request['URL'] + '?';
-       mq python: modules['ZTUtils'].make_query;
-       sort_on sort_on | python: request.get('sort_on', 'Title');
-       sort_order sort_order | python: request.get('sort_order', 'normal');">
-      <tr>
-        <th nowrap="nowrap" width="5%"></th>
-        <th tal:repeat="column python: ['Title', 'Type']"
-            tal:attributes="width python:
-                            column == 'Title' and '50%' or default"
-            align="left">
-          <a href="" tal:omit-tag="python: sort_on == column"
-             tal:attributes="href python: my_url + 
-             mq(request.form, sort_on=column, sort_order='normal')"
-             tal:content="column">Title</a>
-          <a href="" tal:condition="python: sort_on == column"
-             tal:attributes="href python: my_url + mq(request.form,
-             sort_on=column, sort_order=(sort_order == 'normal'
-             and 'reverse' or 'normal'))"><img border="0" tal:attributes="src
-             python: here.absolute_url() + '/' + (
-             sort_order == 'normal' and 'sorted_down_icon' or
-             'sorted_up_icon')" /></a>
-        </th>
-      </tr>
-
-      <tr tal:repeat="item items">
-        <td><input type="checkbox" name="source_paths:list"
-             tal:attributes="value python: '/'.join(item.getPhysicalPath())" />
-        </td>
-
-        <td>
-         <img src="document_icon.gif" border="0"
-              tal:attributes="src item/getIcon | item/icon"
-              tal:on-error="string:" />
-         <span tal:define="title python: item.title or item.id" tal:content="title">TITLE or ID</span>
-        </td>
-
-        <td tal:content="item/Type | item/meta_type" nowrap="nowrap"
-            tal:on-error="string:(unknown)">
-          Type
-        </td>
+  tal:define="my_url python: request['URL'] + '?';
+  mq python: modules['ZTUtils'].make_query;
+  sort_on python: request.get('sort_on', 'ID');
+  sort_order python: request.get('sort_order', 'normal');">
+<tr>
+<th nowrap="nowrap" width="5%"></th>
+<th tal:repeat="column python: ['ID', 'Title', 'Type']"
+  tal:attributes="width python: column == 'Title' and '50%' or default"
+  align="left">
+ <a href="" tal:omit-tag="python: sort_on == column"
+   tal:attributes="href python: my_url + 
+   mq(request.form, sort_on=column, sort_order='normal')"
+   tal:content="column">Column</a>
+ <a href="" tal:condition="python: sort_on == column"
+   tal:attributes="href python: my_url + mq(request.form,
+   sort_on=column, sort_order=(sort_order == 'normal'
+   and 'reverse' or 'normal'))"><img border="0" tal:attributes="src
+   python: here.absolute_url() + '/' + (
+   sort_order == 'normal' and 'sorted_down_icon' or
+   'sorted_up_icon')" /></a>
+</th>
+</tr>
 
-      </tr>
+<tr tal:repeat="item items">
+
+<tal:block tal:condition="item/folderish" tal:define="item_path item/path">
+ <td>
+ </td>
+ <td valign="top" nowrap="nowrap">
+ <a href="#" tal:attributes="href python: my_url + 
+   mq(request.form, source_path=item_path)">
+ <img src="document_icon.gif" border="0" tal:condition="item/icon"
+   tal:attributes="src item/icon" />
+ <span tal:content="item/id">ID</span>
+ </a>
+ </td>
+ <td valign="top" nowrap="nowrap">
+ <span tal:content="item/title">TITLE</span>
+ </td>
+</tal:block>
+
+<tal:block tal:condition="not:item/folderish" tal:define="item_path item/path">
+ <td valign="top" nowrap="nowrap">
+ <input type="checkbox" name="source_paths:list"
+   tal:attributes="value item_path; id item_path" />
+ </td>
+
+ <td valign="top" nowrap="nowrap">
+ <label tal:attributes="for item_path">
+ <img src="document_icon.gif" border="0" tal:condition="item/icon"
+   tal:attributes="src item/icon" />
+ <span tal:content="item/id">ID</span>
+ </label>
+ </td>
+
+ <td valign="top" nowrap="nowrap">
+ <label tal:attributes="for item_path">
+ <span tal:content="item/title">TITLE</span>
+ </label>
+ </td>
+</tal:block>
+
+<td valign="top" tal:content="item/type" nowrap="nowrap">
+ Type
+</td>
+</tr>
 </tbody>
 </table>