diff --git a/common.py b/common.py index 0a8b9c1..2051549 100644 --- a/common.py +++ b/common.py @@ -170,6 +170,10 @@ class AdapterBase(object): def uid(self): return util.getUidForObject(self.context) + @Lazy + def favTitle(self): + return self.title + def getChildren(self, predicates=None): for c in self.context.getChildren(predicates): yield adapted(c, self.languageInfo) diff --git a/concept.py b/concept.py index a8ed614..75497f0 100644 --- a/concept.py +++ b/concept.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2013 Helmut Merz helmutm@cy55.de +# Copyright (c) 2016 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -185,6 +185,10 @@ class Concept(Contained, Persistent): def getLongTitle(self): return self.title + @property + def favTitle(self): + return self.title + # concept relations def getClients(self, relationships=None): diff --git a/organize/personal/browser/favorite.py b/organize/personal/browser/favorite.py index 6f376c3..d52c40e 100644 --- a/organize/personal/browser/favorite.py +++ b/organize/personal/browser/favorite.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2008 Helmut Merz helmutm@cy55.de +# Copyright (c) 2016 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,8 +18,6 @@ """ A view (to be used by listings, portlets, ...) for favorites. - -$Id$ """ from zope import component @@ -28,6 +26,7 @@ from zope.cachedescriptors.property import Lazy from cybertools.browser.configurator import ViewConfigurator, MacroViewProperty from loops.browser.node import NodeView +from loops.common import adapted from loops.organize.party import getPersonForUser from loops.organize.personal.interfaces import IFavorites from loops import util @@ -61,10 +60,11 @@ class FavoriteView(NodeView): for uid in self.favorites.list(self.person): obj = util.getObjectForUid(uid) if obj is not None: + adobj = adapted(obj) yield dict(url=self.getUrlForTarget(obj), uid=uid, - title=obj.title, - description=obj.description, + title=adobj.favTitle, + description=adobj.description, object=obj) def add(self): diff --git a/resource.py b/resource.py index 69acd24..3ffed16 100644 --- a/resource.py +++ b/resource.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2013 Helmut Merz helmutm@cy55.de +# Copyright (c) 2016 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -173,6 +173,10 @@ class Resource(Image, Contained): def getConceptManager(self): return self.getLoopsRoot().getConceptManager() + @property + def favTitle(self): + return self.title + def getAllParents(self, collectGrants=False, ignoreTypes=False): result = Jeep() for rel in self.getConceptRelations():