diff --git a/CHANGES.rst b/CHANGES.rst index e5775788..b6865daa 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,6 +9,9 @@ Breaking changes: - *add item here* New features: +- make thumbsize in folder contents listing adjustable/supressable + (uses site control panel settings: thumb_size_tables ...) + https://github.com/plone/Products.CMFPlone/issues/1734 [fgrcon] - Folder contents rename dialog: In the rename dialog, show image thumbnails in ``thumb`` scale instead of ``icon``. Plones standard ``icon`` scale is way to small to be useful for images. diff --git a/plone/app/content/browser/contents/__init__.py b/plone/app/content/browser/contents/__init__.py index e4ce584a..3de646c6 100644 --- a/plone/app/content/browser/contents/__init__.py +++ b/plone/app/content/browser/contents/__init__.py @@ -7,8 +7,10 @@ from plone.app.content.utils import json_dumps from plone.app.content.utils import json_loads from plone.protect.postonly import check as checkpost +from plone.registry.interfaces import IRegistry from plone.uuid.interfaces import IUUID from Products.CMFCore.utils import getToolByName +from Products.CMFPlone.interfaces.controlpanel import ISiteSchema from Products.CMFPlone import PloneMessageFactory as _ from Products.CMFPlone import utils from Products.Five import BrowserView @@ -242,6 +244,16 @@ def get_columns(self): columns[column] = translate(_(column), context=self.request) return columns + def get_thumbSize(self): + registry = getUtility(IRegistry) + settings = registry.forInterface( + ISiteSchema, prefix="plone", check=False) + if settings.no_thumbs_tables: + # thumbs to be supressed + return 'none' + thumb_size_table = settings.thumb_size_table + return thumb_size_table + def get_options(self): site = get_top_site_from_url(self.context, self.request) base_url = site.absolute_url() @@ -281,6 +293,7 @@ def get_options(self): 'initialFolder': IUUID(self.context, None), 'useTus': TUS_ENABLED }, + 'thumbSize' : self.get_thumbSize(), } return options