Tests plus basiques sur l’affichage des cases à cocher / des boutons.
mtool = getToolByName(script, 'portal_membership')
checkPermission = mtool.checkPermission
mtool = getToolByName(script, 'portal_membership')
checkPermission = mtool.checkPermission
+isAnon = mtool.isAnonymousUser()
utool = getToolByName(script, 'portal_url')
portal_url = utool()
utool = getToolByName(script, 'portal_url')
portal_url = utool()
-columns = ( {'key': 'Lock',
- 'title': '',
- 'width': '16',
- 'colspan': None}
- , {'key': 'Type',
+columns = ( {'key': 'Type',
'title': 'Type',
'width': None,
'colspan': '2'}
'title': 'Type',
'width': None,
'colspan': '2'}
'title': 'Last Modified',
'width': None,
'colspan': None}
'title': 'Last Modified',
'width': None,
'colspan': None}
- # , {'key': 'position',
- # 'title': 'Position',
- # 'width': None,
- # 'colspan': None }
items = sequence.sort( items, ((key, sortFunc, sort_dir),) )
batch_obj = Batch(items, context.default_batch_size, b_start, orphan=0, quantumleap=1)
items = []
items = sequence.sort( items, ((key, sortFunc, sort_dir),) )
batch_obj = Batch(items, context.default_batch_size, b_start, orphan=0, quantumleap=1)
items = []
-display_delete_button = True # TODO : à revoir
+display_delete_button = not isAnon # TODO : à revoir
for item in batch_obj:
item_icon = item.getIcon
item_id = item.getId
item_url = item.getURL()
for item in batch_obj:
item_icon = item.getIcon
item_id = item.getId
item_url = item.getURL()
- #try : item_delete_allowed = context.objectIdCanBeDeleted(item_id)
- #except : item_delete_allowed = checkPermission(DeleteObjects, context) # std zope perm
- #if not display_delete_button :
- # display_delete_button = item_delete_allowed
- {'lock' : False,
- 'checkbox': True,
+ {'checkbox': not isAnon,
'icon': item_icon and ( '%s/%s' % (portal_url, item_icon) ) or '',
'id': item_id,
'modified': item.modified.strftime(locale_date_fmt),
'icon': item_icon and ( '%s/%s' % (portal_url, item_icon) ) or '',
'id': item_id,
'modified': item.modified.strftime(locale_date_fmt),
<tbody id="FolderListingBody">
<tbody tal:repeat="item_info listItemInfos" tal:omit-tag="" metal:define-macro="itemListing">
<tr class="" tal:attributes="class python: (even and 'even') or 'odd'" tal:define="even repeat/item_info/even">
<tbody id="FolderListingBody">
<tbody tal:repeat="item_info listItemInfos" tal:omit-tag="" metal:define-macro="itemListing">
<tr class="" tal:attributes="class python: (even and 'even') or 'odd'" tal:define="even repeat/item_info/even">
- <td><img src="." alt="lock" height="16" width="16" border="0"
- tal:condition="python:not isAnon and item_info['lock']"
- tal:attributes="src here/lock.gif/absolute_url"
- i18n:attributes="alt" /></td>
<td>
<input id="" type="checkbox" name="ids:list" value=""
tal:attributes="value item_info/id; id item_info/checkbox" tal:condition="item_info/checkbox" />
<td>
<input id="" type="checkbox" name="ids:list" value=""
tal:attributes="value item_info/id; id item_info/checkbox" tal:condition="item_info/checkbox" />