-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Plone 5/6 and Python 3 #13
base: master
Are you sure you want to change the base?
Conversation
href=""> | ||
<img tal:replace="structure image/tag" /> | ||
</a> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems weird that image is removed here and in the renderer, but still in the item_display vocabulary. If intentional, should that be mentioned in the history?
@@ -82,7 +71,7 @@ class IContentPortlet(IPortletDataProvider): | |||
value_type=schema.Choice( | |||
vocabulary='collective.portlet.content.item_display_vocabulary', | |||
), | |||
default=[u'date', u'image', u'description', u'body'], | |||
default=[u'date', u'description'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the point of this portlet to display the body?
more_text = u'' | ||
omit_border = False | ||
custom_header = u"" | ||
omit_header = False | ||
|
||
def __init__(self, portlet_title=u'', content=None, title_display=u'link', | ||
item_display=[u'date', u'image', u'description', u'body'], more_text=u'', | ||
item_display=[u'date', u'description'], more_text=u'', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mutable default is a code smell
@@ -149,7 +137,7 @@ def title(self): | |||
"manage portlets" screen. | |||
""" | |||
msg = __(u"Content portlet") | |||
return self.portlet_title or msg | |||
return getattr(uuidToCatalogBrain(self.content), 'Title', None) or msg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should still use portlet_title if set, right?
@@ -226,17 +198,17 @@ def body(self): | |||
|
|||
# Currently nothing stops you from trying to get text from an Image | |||
if hasattr(self.content, 'getText'): | |||
text = self.content.getText() | |||
text = self.content.getText |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The brain probably does not have getText; for this you probably need the real content item
No description provided.