# HG changeset patch # User Thierry Florac # Date 1507038524 -7200 # Node ID 6a26b2b0cb470e479df0c1df33a07fafa3e47691 # Parent 595d2965fc4d4ca47f85ac4b1f655ab6265f5096 Updated paragraphs container management diff -r 595d2965fc4d -r 6a26b2b0cb47 src/pyams_content/component/paragraph/interfaces/__init__.py --- a/src/pyams_content/component/paragraph/interfaces/__init__.py Tue Oct 03 14:44:04 2017 +0200 +++ b/src/pyams_content/component/paragraph/interfaces/__init__.py Tue Oct 03 15:48:44 2017 +0200 @@ -46,7 +46,6 @@ default=True) title = I18nTextLineField(title=_("ยง Title"), - description=_("Paragraph title"), required=False) diff -r 595d2965fc4d -r 6a26b2b0cb47 src/pyams_content/component/paragraph/zmi/container.py --- a/src/pyams_content/component/paragraph/zmi/container.py Tue Oct 03 14:44:04 2017 +0200 +++ b/src/pyams_content/component/paragraph/zmi/container.py Tue Oct 03 15:48:44 2017 +0200 @@ -9,6 +9,7 @@ # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # +from pyams_skin.interfaces.container import ITableElementEditor __docformat__ = 'restructuredtext' @@ -108,6 +109,14 @@ return super(ParagraphContainerTable, self).render() +@adapter_config(context=(IBaseParagraph, IPyAMSLayer, ParagraphContainerTable), provides=ITableElementEditor) +class BaseParagraphTableElementEditor(ContextRequestViewAdapter): + """Base paragraph table element editor""" + + def __new__(cls, *args, **kwargs): + return None + + @adapter_config(name='sorter', context=(IParagraphContainerTarget, IPyAMSLayer, ParagraphContainerTable), provides=IColumn) class ParagraphContainerSorterColumn(ProtectedFormObjectMixin, SorterColumn): @@ -200,25 +209,27 @@ weight = 50 def renderHeadCell(self): - return '' \ - ' ' \ - '   '.format( - title=self.request.localizer.translate(_("Click to open/close all paragraphs editors"))) + \ - super(ParagraphContainerTitleColumn, self).renderHeadCell() + ' ' \ + ' ' \ + '    {title}' \ + ''.format( + hint=self.request.localizer.translate(_("Click to open/close all paragraphs editors")), + title=super(ParagraphContainerTitleColumn, self).renderHeadCell()) def renderCell(self, item): provider = getParagraphTitleHints(item, self.request, self.table) or '' - return '
{provider}' \ - ' ' \ - '   '.format( + return '
{provider}' \ + ' ' \ + ' ' \ + '    {title}' \ + '
'.format( provider=provider, - title=self.request.localizer.translate(_("Click to open/close paragraph editor"))) + \ - '{0}'.format(super(ParagraphContainerTitleColumn, self).renderCell(item)) + \ - '
' + hint=self.request.localizer.translate(_("Click to open/close paragraph editor")), + title=super(ParagraphContainerTitleColumn, self).renderCell(item)) + \ + '
' def getValue(self, obj): return II18n(obj).query_attribute('title', request=self.request) or ' - - - - - - - -'