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

Tres Seaver tseaver@zope.com
Thu, 29 May 2003 14:49:56 -0400


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

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


  - Repair skins breakage:

    o 'story_edit' marshalling error.

  - Implement "most recent 15" for section fronts.

  - Make CMS breadcrumbs emit CMS-centric URLs.

  - Expose effective / expires dates for stories.

  - Compute section list slot.

  - Implement "Tease Story" action for stories.

  - Add knobs to change the includable types for a section (currently
    needs help from ZMI to set property).

  - Add handling for "NITF" as text_format value.

  - First pass at NITF-HTML rendering.

  - *Don't* make folders / sections workflowed.


=== Added File Products/OSCOM/NOTSite/skins/NOTSite/cms_breadcrumbs.py ===
## Script (Python) "cms_breadcrumbs.py"
##parameters=include_root=1
##title=Return breadcrumbs germane to the CMS
##
from string import join

result = []
portal_url = context.portal_url()

if include_root:
    result.append( { 'id'      : 'root'
                   , 'title'   : context.portal_properties.title()
                   , 'url'     : portal_url
                   , 'method'  : 'folder_contents'
                   }
                 )

relative = context.portal_url.getRelativeContentPath( context )
portal = context.portal_url.getPortalObject()

for i in range( len( relative ) ):

    now = relative[ :i+1 ]
    obj = portal.restrictedTraverse( now )
    folderish = getattr( obj, 'isPrincipiaFolderish', 0 )
    contentish = getattr( obj, 'isPortalContent', 0 )
    typeinfo = obj.getTypeInfo()

    if not now[ -1 ] == 'talkback':
        result.append( { 'id'      : now[ -1 ]
                       , 'title'   : obj.Title()
                       , 'url'     : portal_url + '/' + join( now, '/' )
                       , 'method'  : ( folderish and 'folder_contents'
                                       or typeinfo.getActionById( 'edit' ) )
                       }
                    )

return result


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

from Products.CMFCore.utils import getToolByName

result = []

urltool = getToolByName( context, 'portal_url' )
root = urltool.getPortalObject()

for item in root.contentValues():

    typeinfo = item.getTypeInfo()
    folderish = getattr( item, 'isPrincipiaFolderish', 0 )
    if not folderish:
        continue

    path = urltool.getRelativeContentPath( item )

    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
           , 'path'         : '/'.join( path )
           }

    result.append( info )

return result


=== Products/OSCOM/NOTSite/skins/NOTSite/folder_contents.pt 1.1 => 1.2 ===
--- Products/OSCOM/NOTSite/skins/NOTSite/folder_contents.pt:1.1	Tue May 27 01:44:21 2003
+++ Products/OSCOM/NOTSite/skins/NOTSite/folder_contents.pt	Thu May 29 14:49:55 2003
@@ -13,10 +13,11 @@
 >
 <div tal:condition="not: list_here"
       tal:define="response request/RESPONSE;
-                  url here/absolute_url;
+                  url here/portal_url;
                  "
  >
-  <span tal:define="redirect python: response.redirect( url )"></span>
+  <span tal:define="redirect python:response.redirect(
+                                            '%s/login_form' % url )"></span>
 </div>
 
 <!-- This is the desktop area -->


=== Products/OSCOM/NOTSite/skins/NOTSite/list_contents_info.py 1.1 => 1.2 ===
--- Products/OSCOM/NOTSite/skins/NOTSite/list_contents_info.py:1.1	Tue May 27 01:44:21 2003
+++ Products/OSCOM/NOTSite/skins/NOTSite/list_contents_info.py	Thu May 29 14:49:55 2003
@@ -2,9 +2,13 @@
 ##parameters=
 ##title=Return a sequence of mappings describing our content objects.
 
+from Products.CMFCore.utils import getToolByName
+
 result = []
+mtool = getToolByName( context, 'portal_membership' )
 
-for item in context.contentValues():
+for item in [ x for x in context.contentValues()
+                 if mtool.checkPermission( 'View', x ) ]:
 
     typeinfo = item.getTypeInfo()
     folderish = getattr( item, 'isPrincipiaFolderish', 0 )
@@ -12,7 +16,7 @@
 
     info = { 'method'       : folderish and 'folder_contents'
                                          or typeinfo.getActionById( 'edit' )
-           , 'icon'         : item.getIcon()
+           , 'icon'         : typeinfo.getIcon()
            , 'id'           : item.getId()
            , 'title'        : item.Title()
            , 'description'  : item.Description()


=== Products/OSCOM/NOTSite/skins/NOTSite/main_template.pt 1.2 => 1.3 ===
--- Products/OSCOM/NOTSite/skins/NOTSite/main_template.pt:1.2	Tue May 27 01:44:21 2003
+++ Products/OSCOM/NOTSite/skins/NOTSite/main_template.pt	Thu May 29 14:49:55 2003
@@ -94,9 +94,10 @@
  <td width="66%">
 
   <p id="Breadcrumbs" style="padding-top: 5px">
-   <span tal:repeat="bc here/breadcrumbs"
+   <span tal:repeat="bc here/cms_breadcrumbs"
     ><a href="."
-        tal:attributes="href bc/url" tal:content="bc/id"
+        tal:attributes="href string:${bc/url}/${bc/method}"
+        tal:content="bc/id"
      >ID</a><span tal:condition="not: repeat/bc/end">&nbsp;/&nbsp;</span>
    </span>
   </p>


=== Products/OSCOM/NOTSite/skins/NOTSite/site_template_macros.pt 1.2 => 1.3 ===
--- Products/OSCOM/NOTSite/skins/NOTSite/site_template_macros.pt:1.2	Mon May 26 02:03:20 2003
+++ Products/OSCOM/NOTSite/skins/NOTSite/site_template_macros.pt	Thu May 29 14:49:55 2003
@@ -55,35 +55,56 @@
   <img src="images/arrowdir.gif" width="4" heigth="8"><img src="images/pixel.gif" width="4" heigth="8"><a href="/index.html" class="dir">Sections</a>
   </div>
 
-  <div style="padding-left: 13px">
-  <img src="images/arrow.gif" width="4" heigth="8"><img src="images/pixel.gif" width="4" heigth="8"><a href="/politics/index.html">Politics</a>
+  <div style="padding-left: 13px"
+       tal:repeat="section here/list_section_info"
+  >
+    <img src="arrow.gif" width="4" heigth="8">
+    <img src="pixel.gif" width="4" heigth="8">
+    <a href="#"
+       tal:attributes="href section/url"
+       tal:content="section/title"
+    >SECTION_TITLE</a>
   </div>
 
-  <div style="padding-left: 13px">
+  <div style="padding-left: 13px"
+       tal:condition="nothing"
+  >
   <img src="images/arrowfile.gif" width="4" heigth="8"><img src="images/pixel.gif" width="4" heigth="8"><a href="/finance/index.html" class="file">Finance</a>
   </div>
 
-  <div style="padding-left: 13px">
+  <div style="padding-left: 13px"
+       tal:condition="nothing"
+  >
   <img src="images/arrow.gif" width="4" heigth="8"><img src="images/pixel.gif" width="4" heigth="8"><a href="/culture/index.html">Culture</a>
   </div>
 
-  <div style="padding-left: 13px">
+  <div style="padding-left: 13px"
+       tal:condition="nothing"
+  >
   <img src="images/arrow.gif" width="4" heigth="8"><img src="images/pixel.gif" width="4" heigth="8"><a href="/oped/index.html">Opinions&nbsp;&amp;&nbsp;Editorials</a>
   </div>
 
-  <div style="padding-left: 13px">
+  <div style="padding-left: 13px"
+       tal:condition="nothing"
+  >
   <img src="images/arrow.gif" width="4" heigth="8"><img src="images/pixel.gif" width="4" heigth="8"><a href="/socialissues/index.html">Social Issues</a>
   </div>
 
-  <div style="padding-left: 13px">
+  <div style="padding-left: 13px"
+       tal:condition="nothing"
+  >
   <img src="images/arrow.gif" width="4" heigth="8"><img src="images/pixel.gif" width="4" heigth="8"><a href="/sports/index.html">Sports</a>
   </div>
 
-  <div style="padding-left: 13px">
+  <div style="padding-left: 13px"
+       tal:condition="nothing"
+  >
   <img src="images/arrow.gif" width="4" heigth="8"><img src="images/pixel.gif" width="4" heigth="8"><a href="/technology/index.html">Technology</a>
   </div>
 
-  <div style="padding-left: 13px">
+  <div style="padding-left: 13px"
+       tal:condition="nothing"
+  >
   <img src="images/arrow.gif" width="4" heigth="8"><img src="images/pixel.gif" width="4" heigth="8"><a href="/topstories/index.html">Top Stories</a>
   </div>