X-Git-Url: https://scm.cri.mines-paristech.fr/git/Portfolio.git/blobdiff_plain/5e9d5a6ac7b22dbb732acd070728ae8e079ac2ff..a1bb8ac46119133838a8119a5d15c98079d06a6c:/skins/getSelectionPhotosInfos.py?ds=sidebyside diff --git a/skins/getSelectionPhotosInfos.py b/skins/getSelectionPhotosInfos.py index 362f76d..20e6d61 100644 --- a/skins/getSelectionPhotosInfos.py +++ b/skins/getSelectionPhotosInfos.py @@ -15,15 +15,15 @@ toUrl = req.physicalPathToURL lightboxpath = req.SESSION.get('lightboxpath', None) selectionIsLightbox = False if lightboxpath is None : - selection = req.SESSION.get('objects_selection', []) + selection = req.SESSION.get('objects_selection', []) else : - try : - lightbox = portal.restrictedTraverse(lightboxpath) - selection = lightbox.getUidList() - selectionIsLightbox = True - except: - req.SESSION.set('lightboxpath', None) - selection = req.SESSION.get('objects_selection', []) + try : + lightbox = portal.restrictedTraverse(lightboxpath) + selection = lightbox.getUidList() + selectionIsLightbox = True + except: + req.SESSION.set('lightboxpath', None) + selection = req.SESSION.get('objects_selection', []) brains = [uidh.getBrain(uid) for uid in selection] @@ -34,29 +34,29 @@ cart = req.SESSION.get('cart', None) infos = [] for index, b in enumerate(batch) : - path = b.getPath().split('/') - path.insert(portalDepth, 'selectioncontext') - p = b.getObject() - if pptool : - buyable = bool(pptool.getPrintingOptionsFor(p)) - if cart and cart.locked : - buyable = False - else : - buyable = False - - d = {'href': toUrl('/'.join(path)) - ,'thumbUrl' : '%s/getThumbnail' % b.getURL() - ,'thumbSize' : b.getThumbnailSize - ,'title' : ('%s - %s' % (b.Title, b.Description)).strip(' -') - ,'cmf_uid':b.cmf_uid - ,'className':'' - ,'buyable' : buyable - ,'o':b - } - infos.append(d) + path = b.getPath().split('/') + path.insert(portalDepth, 'selectioncontext') + p = b.getObject() + if pptool : + buyable = bool(pptool.getPrintingOptionsFor(p)) + if cart and cart.locked : + buyable = False + else : + buyable = False + + d = {'href': toUrl('/'.join(path)) + ,'thumbUrl' : '%s/getThumbnail' % b.getURL() + ,'thumbSize' : b.getThumbnailSize + ,'title' : ('%s - %s' % (b.Title, b.Description)).strip(' -') + ,'cmf_uid':b.cmf_uid + ,'className':'' + ,'buyable' : buyable + ,'o':b + } + infos.append(d) features = {} -features['del'] = lambda b : '%s/remove_to_selection' % b.getURL() +features['checkbox'] = True features['cart'] = lambda b : '%s/get_slide_buyable_items' % b.getURL() return {'infos' : infos,