From 06261d4b9b1c430f52d16d789583212919aa2e96 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Sun, 8 Dec 2013 22:37:50 +0100 Subject: [PATCH 1/1] =?utf8?q?Simplifications.=20On=20vire=20le=20pictogra?= =?utf8?q?mme=20du=20cadenas=C2=A0:=20personne=20ne=20savait=20=C3=A0=20qu?= =?utf8?q?oi=20=C3=A7a=20servait=E2=80=A6=20Tests=20plus=20basiques=20sur?= =?utf8?q?=20l=E2=80=99affichage=20des=20cases=20=C3=A0=20cocher=20/=20des?= =?utf8?q?=20boutons.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- skins/photo_theme/folder_contents.py | 20 ++++---------------- skins/photo_theme/folder_contents_macros.pt | 4 ---- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/skins/photo_theme/folder_contents.py b/skins/photo_theme/folder_contents.py index 714b8f1..b63159f 100755 --- a/skins/photo_theme/folder_contents.py +++ b/skins/photo_theme/folder_contents.py @@ -15,6 +15,7 @@ from Products.CMFDefault.utils import html_marshal mtool = getToolByName(script, 'portal_membership') checkPermission = mtool.checkPermission +isAnon = mtool.isAnonymousUser() utool = getToolByName(script, 'portal_url') portal_url = utool() @@ -94,11 +95,7 @@ elif (key, reverse) == context.getDefaultSorting(): else: is_default = 0 -columns = ( {'key': 'Lock', - 'title': '', - 'width': '16', - 'colspan': None} - , {'key': 'Type', +columns = ( {'key': 'Type', 'title': 'Type', 'width': None, 'colspan': '2'} @@ -110,10 +107,6 @@ columns = ( {'key': 'Lock', 'title': 'Last Modified', 'width': None, 'colspan': None} - # , {'key': 'position', - # 'title': 'Position', - # 'width': None, - # 'colspan': None } ) for column in columns: @@ -161,18 +154,13 @@ sortFunc = key in ['Type'] and 'nocase' or 'cmp' 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() - #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 items.append( - {'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), diff --git a/skins/photo_theme/folder_contents_macros.pt b/skins/photo_theme/folder_contents_macros.pt index 98177ba..2cb5b03 100644 --- a/skins/photo_theme/folder_contents_macros.pt +++ b/skins/photo_theme/folder_contents_macros.pt @@ -41,10 +41,6 @@ - lock -- 2.20.1