# HG changeset patch # User Damien Correia # Date 1531832978 -7200 # Node ID 67e46871cb2a07541f555c0d14d07b3a708ab15d # Parent dcc20bece9b688c63d928fd589fd8b15cc312018# Parent ae0c84d7029f44d641af13b3d57016df1f2b6d68 Merge default diff -r dcc20bece9b6 -r 67e46871cb2a .hgtags --- a/.hgtags Mon Jun 25 17:26:50 2018 +0200 +++ b/.hgtags Tue Jul 17 15:09:38 2018 +0200 @@ -18,3 +18,5 @@ 95026785904d443509d93895ddf761b7967d9d46 0.1.14 95026785904d443509d93895ddf761b7967d9d46 0.1.14 1978e4dad1d8f950411807ed2df23fd030a39b60 0.1.14 +fc8fe2dede6309db4a8cfc5b53eb894cca2f6970 0.1.15 +9cc7207c1399658ef821a1ecdde86df0b5a1298d 0.1.15.1 diff -r dcc20bece9b6 -r 67e46871cb2a buildout.cfg --- a/buildout.cfg Mon Jun 25 17:26:50 2018 +0200 +++ b/buildout.cfg Tue Jul 17 15:09:38 2018 +0200 @@ -86,4 +86,4 @@ eggs = pyams_content [test] [versions] -pyams_content = 0.1.15 +pyams_content = 0.1.16 diff -r dcc20bece9b6 -r 67e46871cb2a docs/HISTORY.txt --- a/docs/HISTORY.txt Mon Jun 25 17:26:50 2018 +0200 +++ b/docs/HISTORY.txt Tue Jul 17 15:09:38 2018 +0200 @@ -1,12 +1,19 @@ History ======= +0.1.15.1 +-------- + - added request argument when rendering pictogram image + 0.1.15 ------ - - added "basic" illustration component + - added "basic" and "navigation" illustration components - added pictogram selection widget - added optional pictogram to links - added generic menu feature + - added key numbers portlet + - added site container "rename" view to change object URL + - include quick search results table in main dashboard view 0.1.14 ------ diff -r dcc20bece9b6 -r 67e46871cb2a setup.py --- a/setup.py Mon Jun 25 17:26:50 2018 +0200 +++ b/setup.py Tue Jul 17 15:09:38 2018 +0200 @@ -22,7 +22,7 @@ README = os.path.join(DOCS, 'README.txt') HISTORY = os.path.join(DOCS, 'HISTORY.txt') -version = '0.1.15' +version = '0.1.16' long_description = open(README).read() + '\n\n' + open(HISTORY).read() tests_require = [] diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content.egg-info/PKG-INFO --- a/src/pyams_content.egg-info/PKG-INFO Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content.egg-info/PKG-INFO Tue Jul 17 15:09:38 2018 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyams-content -Version: 0.1.15 +Version: 0.1.15.1 Summary: PyAMS base content interfaces and classes Home-page: http://hg.ztfy.org/pyams/pyams_content Author: Thierry Florac @@ -73,12 +73,19 @@ History ======= + 0.1.15.1 + -------- + - added request argument when rendering pictogram image + 0.1.15 ------ - - added "basic" illustration component + - added "basic" and "navigation" illustration components - added pictogram selection widget - added optional pictogram to links - added generic menu feature + - added key numbers portlet + - added site container "rename" view to change object URL + - include quick search results table in main dashboard view 0.1.14 ------ diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content.egg-info/SOURCES.txt --- a/src/pyams_content.egg-info/SOURCES.txt Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content.egg-info/SOURCES.txt Tue Jul 17 15:09:38 2018 +0200 @@ -181,8 +181,11 @@ src/pyams_content/interfaces/__init__.py src/pyams_content/interfaces/container.py src/pyams_content/locales/pyams_content.pot +src/pyams_content/locales/pyams_content.pot.orig src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo +src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo.orig src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po +src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po.orig src/pyams_content/profile/__init__.py src/pyams_content/profile/admin.py src/pyams_content/profile/interfaces/__init__.py @@ -228,6 +231,9 @@ src/pyams_content/shared/common/portlet/content/skin/__init__.py src/pyams_content/shared/common/portlet/content/zmi/__init__.py src/pyams_content/shared/common/portlet/content/zmi/preview.pt +src/pyams_content/shared/common/skin/__init__.py +src/pyams_content/shared/common/skin/oid.py +src/pyams_content/shared/common/skin/url.py src/pyams_content/shared/common/zmi/__init__.py src/pyams_content/shared/common/zmi/dashboard.py src/pyams_content/shared/common/zmi/header.py @@ -236,6 +242,7 @@ src/pyams_content/shared/common/zmi/owner.py src/pyams_content/shared/common/zmi/portal.py src/pyams_content/shared/common/zmi/properties.py +src/pyams_content/shared/common/zmi/rename.py src/pyams_content/shared/common/zmi/search.py src/pyams_content/shared/common/zmi/security.py src/pyams_content/shared/common/zmi/site.py diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/__init__.py --- a/src/pyams_content/__init__.py Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content/__init__.py Tue Jul 17 15:09:38 2018 +0200 @@ -27,7 +27,7 @@ CREATE_CONTENT_PERMISSION, MANAGE_CONTENT_PERMISSION, COMMENT_CONTENT_PERMISSION, PUBLISH_CONTENT_PERMISSION from pyams_content.interfaces import WEBMASTER_ROLE, PILOT_ROLE, MANAGER_ROLE, OWNER_ROLE, CONTRIBUTOR_ROLE, \ READER_ROLE, OPERATOR_ROLE, GUEST_ROLE - from pyams_security.interfaces import ADMIN_USER_ID + from pyams_security.interfaces import ADMIN_USER_ID, SYSTEM_ADMIN_ROLE from pyams_thesaurus.interfaces import CREATE_THESAURUS_PERMISSION, ADMIN_THESAURUS_PERMISSION from pyams_utils.interfaces import PUBLIC_PERMISSION, VIEW_PERMISSION, MANAGE_PERMISSION, \ VIEW_SYSTEM_PERMISSION, MANAGE_ROLES_PERMISSION, MANAGE_SKIN_PERMISSION @@ -48,6 +48,13 @@ config.register_permission({'id': PUBLISH_CONTENT_PERMISSION, 'title': _("Publish content")}) + # update system administrator permissions + config.register_role({'id': SYSTEM_ADMIN_ROLE, + 'title': _("System manager (role)"), + 'permissions': {CREATE_THESAURUS_PERMISSION, ADMIN_THESAURUS_PERMISSION, + MANAGE_SITE_ROOT_PERMISSION, MANAGE_SITE_PERMISSION, MANAGE_TOOL_PERMISSION, + MANAGE_SKIN_PERMISSION}}) + # register custom roles config.register_role({'id': WEBMASTER_ROLE, 'title': _("Webmaster (role)"), @@ -57,7 +64,9 @@ MANAGE_SITE_ROOT_PERMISSION, MANAGE_SITE_PERMISSION, MANAGE_TOOL_PERMISSION, CREATE_CONTENT_PERMISSION, MANAGE_CONTENT_PERMISSION, MANAGE_SKIN_PERMISSION, COMMENT_CONTENT_PERMISSION, PUBLISH_CONTENT_PERMISSION}, - 'managers': {ADMIN_USER_ID, 'role:system.Manager', 'role:pyams.Webmaster'}}) + 'managers': {ADMIN_USER_ID, + 'role:{0}'.format(SYSTEM_ADMIN_ROLE), + 'role:{0}'.format(WEBMASTER_ROLE)}}) config.register_role({'id': PILOT_ROLE, 'title': _("Pilot (role)"), 'permissions': {PUBLIC_PERMISSION, VIEW_PERMISSION, MANAGE_PERMISSION, @@ -65,13 +74,17 @@ MANAGE_SITE_PERMISSION, MANAGE_TOOL_PERMISSION, MANAGE_CONTENT_PERMISSION, COMMENT_CONTENT_PERMISSION, PUBLISH_CONTENT_PERMISSION}, - 'managers': {ADMIN_USER_ID, 'role:system.Manager', 'role:pyams.Webmaster'}}) + 'managers': {ADMIN_USER_ID, + 'role:{0}'.format(SYSTEM_ADMIN_ROLE), + 'role:{0}'.format(WEBMASTER_ROLE)}}) config.register_role({'id': MANAGER_ROLE, 'title': _("Manager (role)"), 'permissions': {PUBLIC_PERMISSION, VIEW_PERMISSION, MANAGE_PERMISSION, VIEW_SYSTEM_PERMISSION, MANAGE_CONTENT_PERMISSION, COMMENT_CONTENT_PERMISSION, PUBLISH_CONTENT_PERMISSION}, - 'managers': {ADMIN_USER_ID, 'role:system.Manager', 'role:pyams.Webmaster', + 'managers': {ADMIN_USER_ID, + 'role:{0}'.format(SYSTEM_ADMIN_ROLE), + 'role:{0}'.format(WEBMASTER_ROLE), 'role:pyams.Pilot'}}) config.register_role({'id': OWNER_ROLE, 'title': _("Owner (role)"), @@ -84,20 +97,32 @@ VIEW_SYSTEM_PERMISSION, CREATE_CONTENT_PERMISSION, MANAGE_CONTENT_PERMISSION, COMMENT_CONTENT_PERMISSION}, - 'managers': {ADMIN_USER_ID, 'role:system.Manager', 'role:pyams.Webmaster', - 'role:pyams.Pilot', 'role:pyams.Owner'}}) + 'managers': {ADMIN_USER_ID, + 'role:{0}'.format(SYSTEM_ADMIN_ROLE), + 'role:{0}'.format(WEBMASTER_ROLE), + 'role:pyams.Pilot', + 'role:pyams.Owner'}}) config.register_role({'id': READER_ROLE, 'title': _("Reader (role)"), 'permissions': {PUBLIC_PERMISSION, VIEW_PERMISSION, MANAGE_PERMISSION, VIEW_SYSTEM_PERMISSION, COMMENT_CONTENT_PERMISSION}, - 'managers': {ADMIN_USER_ID, 'role:system.Manager', 'role:pyams.Webmaster', - 'role:pyams.Pilot', 'role:pyams.Manager', 'role:pyams.Contributor'}}) + 'managers': {ADMIN_USER_ID, + 'role:{0}'.format(SYSTEM_ADMIN_ROLE), + 'role:{0}'.format(WEBMASTER_ROLE), + 'role:pyams.Pilot', + 'role:pyams.Manager', + 'role:pyams.Contributor'}}) config.register_role({'id': OPERATOR_ROLE, 'title': _("Operator (role)"), 'permissions': {PUBLIC_PERMISSION, VIEW_PERMISSION, VIEW_SYSTEM_PERMISSION}, - 'managers': {ADMIN_USER_ID, 'role:system.Manager'}}) + 'managers': {ADMIN_USER_ID, + 'role:{0}'.format(SYSTEM_ADMIN_ROLE)}}) config.register_role({'id': GUEST_ROLE, 'title': _("Guest user (role)"), 'permissions': {PUBLIC_PERMISSION, VIEW_PERMISSION}, - 'managers': {ADMIN_USER_ID, 'role:system.Manager', 'role:pyams.Webmaster', - 'role:pyams.Pilot', 'role:pyams.Manager', 'role:pyams.Contributor'}}) + 'managers': {ADMIN_USER_ID, + 'role:{0}'.format(SYSTEM_ADMIN_ROLE), + 'role:{0}'.format(WEBMASTER_ROLE), + 'role:pyams.Pilot', + 'role:pyams.Manager', + 'role:pyams.Contributor'}}) diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/component/association/__init__.py --- a/src/pyams_content/component/association/__init__.py Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content/component/association/__init__.py Tue Jul 17 15:09:38 2018 +0200 @@ -42,6 +42,9 @@ visible = FieldProperty(IAssociationItem['visible']) + def is_visible(self, request=None): + return True + def get_url(self, request=None, view_name=None): return absolute_url(self, request, view_name) diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/component/association/container.py --- a/src/pyams_content/component/association/container.py Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content/component/association/container.py Tue Jul 17 15:09:38 2018 +0200 @@ -19,6 +19,7 @@ from pyams_content.component.association.interfaces import IAssociationContainer, IAssociationContainerTarget, \ ASSOCIATION_CONTAINER_KEY, IAssociationItem, IAssociationInfo from pyams_content.features.checker.interfaces import IContentChecker +from pyams_zmi.layer import IAdminLayer from zope.location.interfaces import ISublocations from zope.traversing.interfaces import ITraversable @@ -54,8 +55,10 @@ # make sure that association item is correctly indexed index_object(value) - def get_visible_items(self): - return filter(lambda x: IAssociationItem(x).visible, self.values()) + def get_visible_items(self, request=None): + for item in filter(lambda x: IAssociationItem(x).visible, self.values()): + if IAdminLayer.providedBy(request) or item.is_visible(request): + yield item @adapter_config(context=IAssociationContainerTarget, provides=IAssociationContainer) diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/component/association/interfaces/__init__.py --- a/src/pyams_content/component/association/interfaces/__init__.py Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content/component/association/interfaces/__init__.py Tue Jul 17 15:09:38 2018 +0200 @@ -44,6 +44,9 @@ required=True, default=True) + def is_visible(self, request=None): + """Is association item published?""" + def get_url(self, request=None, view_name=None): """Get link URL""" @@ -70,7 +73,7 @@ def append(self, value, notify=True): """Append given value to container""" - def get_visible_items(self): + def get_visible_items(self, request=None): """Get list of visible items""" diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/component/extfile/zmi/__init__.py --- a/src/pyams_content/component/extfile/zmi/__init__.py Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content/component/extfile/zmi/__init__.py Tue Jul 17 15:09:38 2018 +0200 @@ -106,11 +106,6 @@ fields = field.Fields(IExtFile).select('data', 'filename', 'title', 'description', 'author', 'language') edit_permission = MANAGE_CONTENT_PERMISSION - def updateWidgets(self, prefix=None): - super(ExtFileAddForm, self).updateWidgets(prefix) - if 'description' in self.widgets: - self.widgets['description'].widget_css_class = 'textarea' - def create(self, data): factory = EXTERNAL_FILES_FACTORIES.get('file') if factory is not None: @@ -142,11 +137,6 @@ fields = field.Fields(IExtFile).select('data', 'filename', 'title', 'description', 'author', 'language') edit_permission = MANAGE_CONTENT_PERMISSION - def updateWidgets(self, prefix=None): - super(ExtFilePropertiesEditForm, self).updateWidgets(prefix) - if 'description' in self.widgets: - self.widgets['description'].widget_css_class = 'textarea' - def get_ajax_output(self, changes): if ('title' in changes.get(IBaseExtFile, ())) or \ ('filename' in changes.get(IBaseExtFile, ())) or \ diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/component/file/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/component/file/__init__.py Tue Jul 17 15:09:38 2018 +0200 @@ -0,0 +1,41 @@ +# +# Copyright (c) 2008-2018 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_file.interfaces import IFile +from pyams_skin.layer import IPyAMSUserLayer +from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION +from pyams_workflow.interfaces import IWorkflowPublicationInfo + +# import packages +from pyams_file.views.file import FileView +from pyramid.exceptions import NotFound +from pyramid.location import lineage +from pyramid.view import view_config + + +@view_config(context=IFile, request_type=IPyAMSUserLayer) +def ProtectedFileView(request): + """Protected file view""" + context = request.context + if not request.has_permission(VIEW_SYSTEM_PERMISSION, context=context): # authenticated operator + for parent in lineage(context): + publication_info = IWorkflowPublicationInfo(parent, None) + if (publication_info is not None) and not publication_info.is_visible(request): + raise NotFound() + + return FileView(request) diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/component/gallery/interfaces/__init__.py --- a/src/pyams_content/component/gallery/interfaces/__init__.py Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content/component/gallery/interfaces/__init__.py Tue Jul 17 15:09:38 2018 +0200 @@ -60,7 +60,7 @@ author = TextLine(title=_("Author"), description=_("Name of document's author"), - required=False) + required=True) author_comments = I18nTextField(title=_("Author's comments"), description=_("Comments relatives to author's rights management"), @@ -88,6 +88,9 @@ default=True) +GALLERY_FILE_HIDDEN_FIELDS = ('__parent__', '__name__', 'visible') + + class IBaseGallery(IOrderedContainer, IAttributeAnnotatable, IRenderedContent): """Base gallery interface""" diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/component/gallery/zmi/__init__.py --- a/src/pyams_content/component/gallery/zmi/__init__.py Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content/component/gallery/zmi/__init__.py Tue Jul 17 15:09:38 2018 +0200 @@ -68,11 +68,6 @@ edit_permission = MANAGE_CONTENT_PERMISSION - def updateWidgets(self, prefix=None): - super(GalleryPropertiesEditForm, self).updateWidgets(prefix) - if 'description' in self.widgets: - self.widgets['description'].widget_css_class = 'textarea' - def get_ajax_output(self, changes): if 'title' in changes.get(IGallery, ()): return { diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/component/gallery/zmi/file.py --- a/src/pyams_content/component/gallery/zmi/file.py Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content/component/gallery/zmi/file.py Tue Jul 17 15:09:38 2018 +0200 @@ -16,7 +16,8 @@ # import standard library # import interfaces -from pyams_content.component.gallery.interfaces import IGallery, IGalleryFile +from pyams_content.component.gallery.interfaces import IGallery, IGalleryFile, IGalleryParagraph, \ + GALLERY_FILE_HIDDEN_FIELDS from pyams_content.component.gallery.zmi.interfaces import IGalleryMediasAddFields, IGalleryContentsView from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION from pyams_file.interfaces.archive import IArchiveExtractor @@ -37,12 +38,14 @@ from pyams_form.form import AJAXAddForm, ajax_config from pyams_form.group import NamedWidgetsGroup from pyams_pagelet.pagelet import pagelet_config +from pyams_skin.event import get_json_refresh_event from pyams_skin.viewlet.toolbar import ToolbarAction, JsToolbarActionItem from pyams_utils.registry import query_utility from pyams_utils.traversing import get_parent from pyams_utils.url import absolute_url from pyams_viewlet.viewlet import viewlet_config from pyams_zmi.form import AdminDialogEditForm, AdminDialogAddForm +from pyramid.renderers import render from z3c.form import field from zope.lifecycleevent import ObjectCreatedEvent from zope.location import locate @@ -72,11 +75,6 @@ fields = field.Fields(IGalleryMediasAddFields) edit_permission = MANAGE_CONTENT_PERMISSION - def updateWidgets(self, prefix=None): - super(GalleryMediaAddForm, self).updateWidgets(prefix) - if 'author_comments' in self.widgets: - self.widgets['author_comments'].widget_css_class = 'textarea' - def create(self, data): medias = [] medias_data = data['medias_data'] @@ -185,7 +183,7 @@ icon_css_class = 'fa fa-fw fa-picture-o' dialog_class = 'modal-large' - fields = field.Fields(IGalleryFile).omit('__parent__', '__name__', 'visible') + fields = field.Fields(IGalleryFile).omit(*GALLERY_FILE_HIDDEN_FIELDS) edit_permission = MANAGE_CONTENT_PERMISSION @property @@ -195,15 +193,9 @@ def updateWidgets(self, prefix=None): super(GalleryFilePropertiesEditForm, self).updateWidgets(prefix) - if 'description' in self.widgets: - self.widgets['description'].widget_css_class = 'textarea' - if 'author_comments' in self.widgets: - self.widgets['author_comments'].widget_css_class = 'textarea' if 'pif_number' in self.widgets: self.widgets['pif_number'].input_css_class = 'col-md-3' - if 'sound_description' in self.widgets: - self.widgets['sound_description'].widget_css_class = 'textarea' - + def updateGroups(self): self.add_group(NamedWidgetsGroup(self, 'audio_file', self.widgets, ('sound', 'sound_title', 'sound_description'), @@ -227,6 +219,12 @@ 'title': II18n(self.context).query_attribute('title', request=self.request) } }) + paragraph = get_parent(self.context, IGalleryParagraph) + if paragraph is not None: + output.setdefault('events', []).append( + get_json_refresh_event(object_id='media_{0}_{1}'.format(paragraph.__name__, self.context.__name__), + content=render('templates/gallery-media-thumbnail.pt', + {'media': self.context}, request=self.request))) return output diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/component/gallery/zmi/paragraph.py --- a/src/pyams_content/component/gallery/zmi/paragraph.py Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content/component/gallery/zmi/paragraph.py Tue Jul 17 15:09:38 2018 +0200 @@ -18,7 +18,8 @@ # import interfaces from pyams_content.component.gallery.interfaces import IGalleryParagraph, IBaseGallery, GALLERY_PARAGRAPH_TYPE from pyams_content.component.gallery.zmi.interfaces import IGalleryContentsView -from pyams_content.component.paragraph.interfaces import IParagraphContainerTarget, IParagraphContainer +from pyams_content.component.paragraph.interfaces import IParagraphContainerTarget, IParagraphContainer, \ + PARAGRAPH_HIDDEN_FIELDS from pyams_content.component.paragraph.zmi.interfaces import IParagraphInnerEditor, IParagraphContainerView from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION from pyams_form.interfaces.form import IInnerForm, IInnerSubForm @@ -69,14 +70,9 @@ legend = _("Add new gallery") icon_css_class = 'fa fa-fw fa-picture-o' - fields = field.Fields(IGalleryParagraph).omit('__parent__', '__name__', 'visible') + fields = field.Fields(IGalleryParagraph).omit(*PARAGRAPH_HIDDEN_FIELDS) edit_permission = MANAGE_CONTENT_PERMISSION - def updateWidgets(self, prefix=None): - super(GalleryAddForm, self).updateWidgets(prefix) - if 'description' in self.widgets: - self.widgets['description'].widget_css_class = 'textarea' - def create(self, data): return Gallery() @@ -96,16 +92,11 @@ legend = _("Edit gallery properties") icon_css_class = 'fa fa-fw fa-picture-o' - fields = field.Fields(IGalleryParagraph).omit('__parent__', '__name__', 'visible') + fields = field.Fields(IGalleryParagraph).omit(*PARAGRAPH_HIDDEN_FIELDS) fields['renderer'].widgetFactory = RendererFieldWidget edit_permission = MANAGE_CONTENT_PERMISSION - def updateWidgets(self, prefix=None): - super(GalleryPropertiesEditForm, self).updateWidgets(prefix) - if 'description' in self.widgets: - self.widgets['description'].widget_css_class = 'textarea' - def get_ajax_output(self, changes): updated = changes.get(IBaseGallery, ()) if 'title' in updated: diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/component/gallery/zmi/templates/gallery-media-thumbnail.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/component/gallery/zmi/templates/gallery-media-thumbnail.pt Tue Jul 17 15:09:38 2018 +0200 @@ -0,0 +1,13 @@ + diff -r dcc20bece9b6 -r 67e46871cb2a src/pyams_content/component/gallery/zmi/templates/gallery-medias.pt --- a/src/pyams_content/component/gallery/zmi/templates/gallery-medias.pt Mon Jun 25 17:26:50 2018 +0200 +++ b/src/pyams_content/component/gallery/zmi/templates/gallery-medias.pt Tue Jul 17 15:09:38 2018 +0200 @@ -1,7 +1,7 @@
@@ -13,7 +13,7 @@
@@ -21,7 +21,7 @@