Skip to content

Commit

Permalink
Merge pull request #11 from fgrcon/master
Browse files Browse the repository at this point in the history
PR: Cleanup and rework: contenttype-icons and ...
  • Loading branch information
vangheem committed Nov 11, 2015
2 parents 7da5ac4 + 3dd907a commit 2754f8b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 40 deletions.
8 changes: 5 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ New:

Fixes:

- *add item here*


- Cleanup and rework: contenttype-icons and showing thumbnails
for images/leadimages in listings
https://github.com/plone/Products.CMFPlone/issues/1226
[fgrcon]

1.2.2 (2015-09-20)
------------------

Expand Down
6 changes: 0 additions & 6 deletions plone/app/contentlisting/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ def uuid(self):
return uuid
return self.getPath()

def getIcon(self):
return queryMultiAdapter(
(self._brain, self.request, self._brain),
interface=IContentIcon
)()

def getSize(self):
return self._brain.getObjSize

Expand Down
3 changes: 0 additions & 3 deletions plone/app/contentlisting/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ def getURL(relative=False):
def uuid():
"""Unique content identifier."""

def getIcon():
"""icon for the object."""

def getSize():
"""size in bytes."""

Expand Down
6 changes: 0 additions & 6 deletions plone/app/contentlisting/realobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ def uuid(self):
return uuid
return self.getPath()

def getIcon(self):
obj = self.getObject()
return queryMultiAdapter(
(obj, self.request, obj),
interface=IContentIcon)()

def review_state(self):
obj = self.getObject()
wftool = getToolByName(obj, "portal_workflow")
Expand Down
22 changes: 0 additions & 22 deletions plone/app/contentlisting/tests/test_integration_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,6 @@ def test_item_getURL(self):
)
self.assertEqual(self.item.getURL(), self.realitem.absolute_url())

def test_item_getIcon(self):
# since icons were changed to css sprites for most types for Plone 4,
# this one needs to use an image for the test.
self.folder.invokeFactory(
'Image', 'myimage', title='My Image', description='blah')
self.item = self.folder.restrictedTraverse('@@folderListing')()[1]
self.assertEqual(
self.item.getIcon(),
u'<img width="16" height="16" src="http://nohost/plone/png.png" '
u'alt="Image" />')

def test_item_getSize(self):
self.assertEqual(self.item.getSize().upper(), '0 KB')
Expand Down Expand Up @@ -204,18 +194,6 @@ def test_item_getURL(self):
'http://nohost/plone/test-folder/mypage')
self.assertEqual(self.item.getURL(), self.realitem.absolute_url())

def test_item_getIcon(self):
# since icons were changed to css sprites for most types for Plone 4,
# this one needs to use an image for the test.
self.folder.invokeFactory(
'Image', 'myimage', title='My Image', description='blah')
self.item = IContentListingObject(self.folder.myimage)
self.assertEqual(
self.item.getIcon(),
u'<img width="16" height="16" src="http://nohost/plone/error_icon.png" ' # noqa
u'alt="My Image" />'
)

def test_item_reviewState(self):
wftool = getToolByName(self.realitem, "portal_workflow")
wf = wftool.getInfoFor(self.realitem, 'review_state')
Expand Down

0 comments on commit 2754f8b

Please sign in to comment.