Changeset 1704


Ignore:
Timestamp:
05/04/07 15:27:10 (12 years ago)
Author:
pjotr
Message:

Trash folder viewable for anyone, folder view will only show stuff for managers

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ConfigurationMethods.py

    r1691 r1704  
    180180    folder.manage_permission(LIST_FOLDER_CONTENTS, ('Member',), acquire=1) 
    181181    folder.manage_permission(ADD_TOPICS, ('Member',), acquire=1) 
    182     folder.manage_permission('View', ('Manager',), acquire=0) 
     182    folder.manage_permission('View', ('Manager', 'Anonymous',), acquire=1) 
    183183 
    184184def setupGroups(self, portal): 
  • trunk/LargeSectionFolder.py

    r1698 r1704  
    10441044    security = ClassSecurityInfo() 
    10451045 
    1046     def getTrashFolderContents(self): 
    1047         """ Get contents for trash folder """ 
    1048         catalog = getToolByName(self, 'portal_catalog') 
    1049         results = catalog.searchResults(path = {'query' : '/'.join(self.getPhysicalPath()), 
    1050                                                 'depth' : 1 }, 
    1051                                         sort_on = 'getObjPositionInParent', 
    1052                                         ) 
    1053         return results 
    1054  
    10551046         
    10561047registerType(LargeContentFolder, PROJECTNAME) 
  • trunk/skins/lemill/lemill_trash_view.pt

    r1698 r1704  
    55<body> 
    66 
    7 <div metal:fill-slot="main" style="width:100%"> 
     7<div metal:fill-slot="main" style="width:100%" 
     8    tal:define="all_content_types context/getAllContentTypes"> 
    89 
    910    <h1>Trash folder</h1> 
    1011 
    11     <table tal:condition="context/getTrashFolderContents" width="100%"> 
     12    <div tal:condition="python: 'Manager' not in member.getRolesInContext(here)">This section might only be of interest for managers. It will not offer anything interesting for all the others.</div> 
     13 
     14    <span tal:omit-tag="" tal:condition="python: 'Manager' in member.getRolesInContext(here)"> 
     15    <table tal:condition="context/objectValues" width="100%"> 
    1216        <tr> 
    1317            <th align="left">Number</th> 
     
    1519            <th align="left">Meta-Type</th> 
    1620        </tr> 
    17         <tr tal:repeat="item context/getTrashFolderContents"> 
     21        <span tal:omit-tag="" tal:repeat="item context/objectValues"> 
     22        <tr tal:condition="python:item.meta_type in all_content_types"> 
    1823            <td tal:content="repeat/item/number">#</td> 
    19             <td><a href="" tal:attributes="href item/getId" tal:content="item/Title">Title</a></td> 
     24            <td><a href="" tal:attributes="href item/absolute_url" tal:content="item/title">Title</a></td> 
    2025            <td tal:content="item/meta_type">Meta-Type</td> 
    2126        </tr> 
     27        </span> 
    2228    </table> 
     29    </span> 
    2330</div> 
    2431</body> 
Note: See TracChangeset for help on using the changeset viewer.