Skip to content
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

make thumb size in folder contents listing adjustable/supressable (… #703

Merged
merged 1 commit into from
Jun 1, 2017

Conversation

fgrcon
Copy link
Member

@fgrcon fgrcon commented Sep 1, 2016

…uses site control panel settings: thumb_size_tables ...) plone/Products.CMFPlone#1734

@thet
Copy link
Member

thet commented Sep 2, 2016

hi @fgrcon - i don't fully understand your PR. the is already configurable (done in this PR: #651 ). it just falls back to the default thumb, whereas your PR doesn't show the icon at all if it wasn't confgured.

@fgrcon
Copy link
Member Author

fgrcon commented Sep 3, 2016

Hi @thet ,
this is still work in progress (documentation will follow..)
.
What i intented in this case, was just to add ui to your last improvement (and renamed icon-size to thumb size for more clarity). PRs in plone/Products.CMFPlone#1734 are interdependend.

configurwtableview

added thumb size to pattern data in pr https://github.com/plone/plone.app.content/pull/106/files :

diff --git a/plone/app/content/browser/contents/__init__.py b/plone/app/content/browser/contents/__init__.py
index e4ce584..3de646c 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.interfaces import IStructureAction
 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 @@ class FolderContentsView(BrowserView):
                 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 @@ class FolderContentsView(BrowserView):
                 'initialFolder': IUUID(self.context, None),
                 'useTus': TUS_ENABLED
             },
+            'thumbSize' : self.get_thumbSize(),
         }
         return options

But it is always possible that i have overlooked something important - please tell me if so.

@fgrcon
Copy link
Member Author

fgrcon commented Sep 4, 2016

@thet: please help - Im somehow lost:
travis:

 .... /home/travis/build/plone/mockup/mockup/tests/pattern-structure-test.js:624:63
PhantomJS 2.1.1 (Linux 0.0.0): Executed 229 of 276 (1 FAILED) (skipped 2) (0 secs / 3.411 secs)
    ✗ should display an icon for contents with images
    expected 'image- pull-right' to contain 'image-largest_possible'

where should image-largest_possible come from?

... t@debian:/usr/local/p5dev/2buildout# grep -rnw . -e "image-largest_possible"
./src/mockup/mockup/tests/pattern-structure-test.js:624:      expect($('.title img', el).attr('class')).to.have.string('image-largest_possible');

(nothing else found)

(uses site control panel settings: thumb_size_tables ...)
replace meaningless paper clip icon (fontello) with mime type icons
from mimetype registry   plone/Products.CMFPlone#1734
@ebrehault ebrehault merged commit 1be9588 into master Jun 1, 2017
@fgrcon fgrcon mentioned this pull request Jun 13, 2017
@thet thet deleted the plip1734thumbs branch June 13, 2017 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants