[Zope-CVS] CVS: Products/OSCOM/NOTSite/skins/NOTSite - folder_contents.pt:1.1 list_contents_info.py:1.1 main_template.pt:1.2

Tres Seaver tseaver@zope.com
Tue, 27 May 2003 01:44:22 -0400


Update of /cvs-repository/Products/OSCOM/NOTSite/skins/NOTSite
In directory cvs.zope.org:/tmp/cvs-serv4931/skins/NOTSite

Modified Files:
	main_template.pt 
Added Files:
	folder_contents.pt list_contents_info.py 
Log Message:


  - Repaired 'index_html' for site root, by redirecting to 'folder_contents'.

  - Made 'folder_contents' use appropriate actions (rather than 'view').

  - Ripped filtering cruft out of 'folder_contents'.

  - Adjusted location / presentation of breadcrumbs, status message,
    on CMS template.

  - Added notes about remaining feature work to the TODO.txt file.


=== Added File Products/OSCOM/NOTSite/skins/NOTSite/folder_contents.pt ===
<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"
     tal:define="m_tool here/portal_membership;
                 checkPerm nocall: m_tool/checkPermission;
                 list_here python:checkPerm('List folder contents', here);
                 list_parent python:checkPerm( 'List folder contents', here
                                             , 'aq_parent' );
                "
>
<div tal:condition="not: list_here"
      tal:define="response request/RESPONSE;
                  url here/absolute_url;
                 "
 >
  <span tal:define="redirect python: response.redirect( url )"></span>
</div>

<!-- This is the desktop area -->
<div class="Desktop"
     tal:define="items here/list_contents_info;
                 b_start string:0;
                 b_start request/b_start | b_start;
                 Batch nocall: modules/ZTUtils/Batch;
                 batch1 python:Batch( items, 20, int(b_start), orphan=0 );
                 batch2 batch1/next;
                " >

<form action="" method="POST"
      tal:attributes="action here/absolute_url">
 <table width="100%">
  <tr>
   <td valign="top">
    <table width="100%">
     <!-- Navigate to parent -->
     <tbody tal:condition="list_parent">
      <tr valign="top"
          tal:define="upNav python: hasattr(here.aq_parent, 'portal_url');
                      upID python: here.aq_parent.getId()">
        <td colspan="3" align="left">
         <span tal:condition="upNav | nothing">
          <a href="../folder_contents"
          ><img src="" alt="[Link]" border="0"
                tal:attributes="src string:${here/portal_url}/UpFolder_icon.gif"
          ></a>
         </span>&nbsp;&nbsp;
         <span tal:condition="upNav">
          Up to <a href="../folder_contents"
                   tal:content="upID">Up ID</a>
         </span>
         <span tal:condition="python: not(upNav)">
           <span class="mild">Root</span>
         </span>
        </td>
      </tr>
     </tbody>
     <!-- This row holds the "two column list" -->
     <tr width="100%">
      <!-- First column, first half batch in 'batch1'. -->
      <td colspan="1" align="left" width="49%">
       <table>
        <tr align="top" tal:repeat="item batch1">
         <td align="left" width="5" nowrap>
            <input type="checkbox" name="ids:list" value="" id=""
                   tal:attributes="value item/id;
                                   id string:cb_${item/id};
                                  " />
         </td>
         <td>
          <span tal:condition="item/icon | nothing">
           <a href=""
              tal:attributes="href string:${item/url}/${item/method};
                             "
           ><img src="" alt="" border="0"
                 tal:attributes="src string:${here/portal_url}/${item/icon};
                                 alt item/type | nothing;
                                "></a>
          </span>
         </td>
         <td>
          <a href=""
             tal:attributes="href string:${item/url}/${item/method};
                            "
          ><span tal:replace="item/id">ID</span>
           <span tal:condition="item/title"
                 tal:replace="string:(${item/title})">(Title)</span></a>
         </td>      
        </tr>
       </table>
      </td>
      <!-- Spacer column. -->
      <td width="2%">&nbsp;</td>
      <!-- Second column, second half batch in 'batch2'. -->
      <td colspan="1" width="49%">
       <table>
        <tr align="top" tal:repeat="item batch2">
         <td align="left" width="5" nowrap>
            <input type="checkbox" name="ids:list" value="" id=""
                   tal:attributes="value item/id;
                                   id string:cb_${item/id}" />
         </td>
         <td>
          <span tal:condition="item/icon | nothing">
           <a href=""
              tal:attributes="href string:${item/url}/${item/method};
                             "
           ><img src="" alt="" border="0"
                 tal:attributes="src string:${here/portal_url}/${item/icon};
                                 alt item/type | nothing;
                                "></a>
          </span>
         </td>
         <td>
          <a href=""
             tal:attributes="href string:${item/url}/${item/method};
                            "
          ><span tal:replace="item/id">ID</span>
           <span tal:condition="item/title"
                 tal:replace="string:(${item/title})">(Title)</span></a>
         </td>      
        </tr>
       </table>
      </td>
        
     </tr>
 
     <tr>
      <td align="left">
       <span tal:define="p batch1/previous" tal:condition="p">
        <a href=""
           tal:attributes="
                href string:folder_contents?b_start=${p/previous/first}"
        >Previous Items</a>
       </span>
      </td>
      <td>&nbsp;</td>
      <td align="right">
       <span tal:define="n batch2/next | nothing" tal:condition="n">
        <a href=""
           tal:attributes="
                href string:folder_contents?b_start=${batch2/end}"
        >Next Items</a>
       </span>
      </td>
     </tr>
    <!-- end contentList -->
    </table>

    <table border="0" cellspacing="0" cellpadding=2>
     <tr>
      <td align="left" valign="top" width="16"></td>
      <td align="left" valign="top">
      <span tal:condition="python: checkPerm('Add portal content', here)">
        <input type="submit" name="folder_factories:method" value="New...">
      </span>
      <span tal:condition="python: checkPerm('View management screens', here)">
        <input type="submit" name="folder_rename_form:method" value="Rename">
        <input type="submit" name="folder_cut:method" value="Cut"> 
        <input type="submit" name="folder_copy:method" value="Copy">
        <span tal:condition="here/cb_dataValid">
        <input type="submit" name="folder_paste:method" value="Paste">
        </span>
      </span>
      <span tal:condition="python: checkPerm('Delete objects', here)">
        <input type="submit" name="folder_delete:method" value="Delete">
      </span>
      </td>
     </tr>
    </table>

   </td>
  </tr>
 </table>
</form>

</div>
</div>
</body>
</html>


=== Added File Products/OSCOM/NOTSite/skins/NOTSite/list_contents_info.py ===
## Script (Python) "list_contents_info"
##parameters=
##title=Return a sequence of mappings describing our content objects.

result = []

for item in context.contentValues():

    typeinfo = item.getTypeInfo()
    folderish = getattr( item, 'isPrincipiaFolderish', 0 )
    contentish = getattr( item, 'isPortalContent', 0 )

    info = { 'method'       : folderish and 'folder_contents'
                                         or typeinfo.getActionById( 'edit' )
           , 'icon'         : item.getIcon()
           , 'id'           : item.getId()
           , 'title'        : item.Title()
           , 'description'  : item.Description()
           , 'url'          : item.absolute_url()
           , 'type'         : typeinfo.Title()  # label, not lookup
           }

    result.append( info )

return result


=== Products/OSCOM/NOTSite/skins/NOTSite/main_template.pt 1.1 => 1.2 ===
--- Products/OSCOM/NOTSite/skins/NOTSite/main_template.pt:1.1	Mon May 26 01:51:36 2003
+++ Products/OSCOM/NOTSite/skins/NOTSite/main_template.pt	Tue May 27 01:44:21 2003
@@ -89,7 +89,9 @@
         width="100%" border="0" cellpadding="0" cellspacing="0" >
  <tr>
 
- <td id="ForematterCell" width="66%">
+ <td width="2%">&nbsp;</td>
+
+ <td width="66%">
 
   <p id="Breadcrumbs" style="padding-top: 5px">
    <span tal:repeat="bc here/breadcrumbs"
@@ -109,9 +111,13 @@
 
  <tr>
 
+ <td>&nbsp;</td>
+
+ <td colspan="2">
   <p id="DesktopStatusBar"
      tal:condition="request/portal_status_message|nothing"
      tal:content="request/portal_status_message"> Status message.</p>
+ </td>
  </tr>
  </table>
  <!-- end formatter -->