diff --git a/browser/common.py b/browser/common.py index b61f4ef..6cb9f55 100644 --- a/browser/common.py +++ b/browser/common.py @@ -176,6 +176,14 @@ class BaseView(GenericView, I18NView): def loopsRoot(self): return self.context.getLoopsRoot() + @Lazy + def conceptManager(self): + return self.loopsRoot.getConceptManager() + + @Lazy + def typePredicate(self): + return self.conceptManager.getTypePredicate() + @Lazy def url(self): return absoluteURL(self.context, self.request) diff --git a/compound/blog/browser.py b/compound/blog/browser.py index 1168bab..2681ed6 100755 --- a/compound/blog/browser.py +++ b/compound/blog/browser.py @@ -119,6 +119,13 @@ class BlogView(ConceptView): if k != 'blogpost']) return sorted(rels, key=lambda r: (r.order, r.title.lower())) + def isPersonalBlog(self): + tPerson = self.loopsRoot.getConceptManager()['person'] + for p in self.context.getParents(): + if p.conceptType == tPerson: + return True + return False + class BlogPostView(ConceptView): @@ -134,6 +141,11 @@ class BlogPostView(ConceptView): data['privateComment'] = u'' return data + @Lazy + def description(self): + return self.renderText(self.context.description, 'text/restructured') + + def getActions(self, category='object', page=None, target=None): actions = [] if category == 'portlet' and self.editable: diff --git a/compound/blog/view_macros.pt b/compound/blog/view_macros.pt index 476316d..e5c5f4c 100755 --- a/compound/blog/view_macros.pt +++ b/compound/blog/view_macros.pt @@ -21,8 +21,7 @@
- Description
+ Description
@@ -55,8 +54,7 @@
- Description + Description
Here comes the text...