From a288ae3854ae4b1b15d003c0a2b837dca15316f8 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Thu, 16 Mar 2023 10:00:56 +0100 Subject: [PATCH 01/15] Configuring with plone/meta --- .editorconfig | 39 ++++++++++++++++++++++++++++++++ .meta.toml | 5 +++++ .pre-commit-config.yaml | 42 ++++++++++++++++++++++++++++++++++ news/243ca9ec.internal | 2 ++ pyproject.toml | 45 ++++++++++++++++++++++++++++++++----- setup.cfg | 25 +++++++++++++++++---- tox.ini | 50 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 199 insertions(+), 9 deletions(-) create mode 100644 .editorconfig create mode 100644 .meta.toml create mode 100644 .pre-commit-config.yaml create mode 100644 news/243ca9ec.internal create mode 100644 tox.ini diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..b4158b89 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,39 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +# +# EditorConfig Configuration file, for more details see: +# http://EditorConfig.org +# EditorConfig is a convention description, that could be interpreted +# by multiple editors to enforce common coding conventions for specific +# file types + +# top-most EditorConfig file: +# Will ignore other EditorConfig files in Home directory or upper tree level. +root = true + + +[*] # For All Files +# Unix-style newlines with a newline ending every file +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +# Set default charset +charset = utf-8 +# Indent style default +indent_style = space +# Max Line Length - a hard line wrap, should be disabled +max_line_length = off + +[*.{py,cfg,ini}] +# 4 space indentation +indent_size = 4 + +[*.{yml,zpt,pt,dtml,zcml}] +# 2 space indentation +indent_size = 2 + +[{Makefile,.gitmodules}] +# Tab indentation (no size specified, but view as 4 spaces) +indent_style = tab +indent_size = unset +tab_width = unset diff --git a/.meta.toml b/.meta.toml new file mode 100644 index 00000000..4ed1a1df --- /dev/null +++ b/.meta.toml @@ -0,0 +1,5 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +[meta] +template = "default" +commit-id = "789b0936" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..582f8acd --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,42 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +ci: + autofix_prs: false + autoupdate_schedule: monthly + +repos: +- repo: https://github.com/asottile/pyupgrade + rev: v3.3.1 + hooks: + - id: pyupgrade + args: [--py38-plus] +- repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort +- repo: https://github.com/psf/black + rev: 23.1.0 + hooks: + - id: black +- repo: https://github.com/collective/zpretty + rev: 3.0.2 + hooks: + - id: zpretty +- repo: https://github.com/PyCQA/flake8 + rev: 6.0.0 + hooks: + - id: flake8 +- repo: https://github.com/codespell-project/codespell + rev: v2.2.2 + hooks: + - id: codespell + additional_dependencies: + - tomli +- repo: https://github.com/mgedmin/check-manifest + rev: "0.49" + hooks: + - id: check-manifest +- repo: https://github.com/regebro/pyroma + rev: "4.2" + hooks: + - id: pyroma diff --git a/news/243ca9ec.internal b/news/243ca9ec.internal new file mode 100644 index 00000000..c08f5399 --- /dev/null +++ b/news/243ca9ec.internal @@ -0,0 +1,2 @@ +Update configuration files. +[plone devs] diff --git a/pyproject.toml b/pyproject.toml index 4dca6482..9eb73f3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,5 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default [tool.towncrier] filename = "CHANGES.rst" directory = "news/" @@ -19,9 +21,42 @@ directory = "bugfix" name = "Bug fixes:" showcontent = true +[[tool.towncrier.type]] +directory = "internal" +name = "Internal:" +showcontent = true + +[[tool.towncrier.type]] +directory = "documentation" +name = "Documentation:" +showcontent = true + +[[tool.towncrier.type]] +directory = "tests" +name = "Tests" +showcontent = true + [tool.isort] -# black compatible Plone isort rules: -profile = "black" -force_alphabetical_sort = true -force_single_line = true -lines_after_imports = 2 \ No newline at end of file +profile = "plone" + +[tool.black] +target-version = ["py38"] + +[tool.dependencychecker] +Zope = [ + # Zope own provided namespaces + 'App', 'OFS', 'Products.Five', 'Products.OFSP', 'Products.PageTemplates', + 'Products.SiteAccess', 'Shared', 'Testing', 'ZPublisher', 'ZTUtils', + 'Zope2', 'webdav', 'zmi', + # Zope dependencies + 'Acquisition', 'DateTime', 'transaction', 'zExceptions', 'ZODB', 'zope.component', + 'zope.configuration', 'zope.container', 'zope.deferredimport', 'zope.event', + 'zope.exceptions', 'zope.globalrequest', 'zope.i18n', 'zope.i18nmessageid', + 'zope.interface', 'zope.lifecycleevent', 'zope.location', 'zope.publisher', + 'zope.schema', 'zope.security', 'zope.site', 'zope.traversing', 'AccessControl', +] +'plone.base' = [ + 'AccessControl', 'Products.BTreeFolder2', 'Products.CMFCore', + 'Products.CMFDynamicViewFTI', 'zope.deprecation', +] +python-dateutil = ['dateutil'] diff --git a/setup.cfg b/setup.cfg index ffe928aa..4a2916b8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,25 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +[bdist_wheel] +universal = 0 + +[flake8] +doctests = 1 +ignore = + # black takes care of line length + E501, + # black takes care of where to break lines + W503, + # black takes care of spaces within slicing (list[:]) + E203, + # black takes care of spaces after commas + E231, + [check-manifest] ignore = + .editorconfig + .meta.toml + .pre-commit-config.yaml + tox.ini *.cfg requirements.txt - - -[bdist_wheel] -universal = 0 diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..4e18961e --- /dev/null +++ b/tox.ini @@ -0,0 +1,50 @@ +# Generated from: +# https://github.com/plone/meta/tree/master/config/default +[tox] +envlist = + format + lint + test + +[testenv] +allowlist_externals = + sh + +[testenv:format] +description = automatically reformat code +skip_install = true +deps = + pre-commit +commands = + pre-commit run -a pyupgrade + pre-commit run -a isort + pre-commit run -a black + pre-commit run -a zpretty + +[testenv:lint] +description = run linters that will help improve the code style +skip_install = true +deps = + pre-commit +commands = + pre-commit run -a + +[testenv:dependencies] +description = check if the package defines all its dependencies and generate a graph out of them +deps = + z3c.dependencychecker==2.11 + pipdeptree==2.5.1 + graphviz # optional dependency of pipdeptree +commands = + dependencychecker + sh -c 'pipdeptree --exclude setuptools,wheel,pipdeptree,z3c.dependencychecker,zope.interface,zope.component --graph-output svg > dependencies.svg' + +[testenv:test] +usedevelop = true +deps = + zope.testrunner + -c https://dist.plone.org/release/6.0-dev/constraints.txt +commands = + zope-testrunner --test-path={toxinidir} -s plone.app.z3cform +extras = + test From c4bbfa7d1355bd26eda140510665c5f710208865 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Thu, 16 Mar 2023 10:03:02 +0100 Subject: [PATCH 02/15] chore: pyupgrade --- plone/app/z3cform/widget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plone/app/z3cform/widget.py b/plone/app/z3cform/widget.py index 95e89cb2..c1507a69 100644 --- a/plone/app/z3cform/widget.py +++ b/plone/app/z3cform/widget.py @@ -788,7 +788,7 @@ def render_input_mode(self): mt_select = etree.Element("select") mt_select.attrib["id"] = f"{self.id}_text_format" mt_select.attrib["name"] = f"{self.name}.mimeType" - mt_select.attrib["class"] = "form-select {}".format(mt_pattern_name) + mt_select.attrib["class"] = f"form-select {mt_pattern_name}" mt_select.attrib[f"data-{mt_pattern_name}"] = json.dumps( { "textareaName": self.name, From 4376d97885299d55a5cf05c1cde2400aff7a810f Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Thu, 16 Mar 2023 10:04:05 +0100 Subject: [PATCH 03/15] fix: isort is configured in pyproject.toml now --- .isort.cfg | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .isort.cfg diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index dd9f25db..00000000 --- a/.isort.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[settings] -force_alphabetical_sort = True -force_single_line = True -lines_after_imports = 2 -line_length = 200 -not_skip = __init__.py From 8395f06bcdc766c720965760f24ec9af2ef66804 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Thu, 16 Mar 2023 10:04:48 +0100 Subject: [PATCH 04/15] chore: isort --- plone/app/z3cform/converters.py | 2 +- plone/app/z3cform/interfaces.py | 4 +--- plone/app/z3cform/tests/test_widgets.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plone/app/z3cform/converters.py b/plone/app/z3cform/converters.py index cf3dabe6..5cb72c2a 100644 --- a/plone/app/z3cform/converters.py +++ b/plone/app/z3cform/converters.py @@ -11,9 +11,9 @@ from plone.app.z3cform.interfaces import ISelectWidget from plone.app.z3cform.interfaces import ISingleCheckBoxBoolWidget from plone.app.z3cform.interfaces import ITimeWidget +from plone.base.utils import safe_callable from plone.uuid.interfaces import IUUID from Products.CMFCore.utils import getToolByName -from plone.base.utils import safe_callable from z3c.form.converter import BaseDataConverter from z3c.form.converter import CollectionSequenceDataConverter from z3c.form.converter import SequenceDataConverter diff --git a/plone/app/z3cform/interfaces.py b/plone/app/z3cform/interfaces.py index 6ffce277..82f09f4c 100644 --- a/plone/app/z3cform/interfaces.py +++ b/plone/app/z3cform/interfaces.py @@ -1,6 +1,4 @@ -from plone.app.textfield.widget import ( - IRichTextWidget as patextfield_IRichTextWidget, -) # noqa +from plone.app.textfield.widget import IRichTextWidget as patextfield_IRichTextWidget from z3c.form.interfaces import IFormLayer from z3c.form.interfaces import IRadioWidget from z3c.form.interfaces import ISelectWidget as IBaseSelectWidget diff --git a/plone/app/z3cform/tests/test_widgets.py b/plone/app/z3cform/tests/test_widgets.py index 726b7c0f..180b20e0 100644 --- a/plone/app/z3cform/tests/test_widgets.py +++ b/plone/app/z3cform/tests/test_widgets.py @@ -13,12 +13,12 @@ from plone.app.z3cform.widget import RelatedItemsWidget from plone.autoform.directives import widget from plone.autoform.form import AutoExtensibleForm +from plone.base.interfaces import IMarkupSchema from plone.dexterity.fti import DexterityFTI from plone.registry.interfaces import IRegistry from plone.supermodel.model import Schema from plone.testing.zca import UNIT_TESTING from plone.uuid.interfaces import IUUID -from plone.base.interfaces import IMarkupSchema from unittest import mock from unittest.mock import Mock from z3c.form.form import EditForm From 192d3bfa8aaf461b2d4b0572bfb299be7fef0b70 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Thu, 16 Mar 2023 10:05:33 +0100 Subject: [PATCH 05/15] chore: black --- plone/app/z3cform/converters.py | 2 + plone/app/z3cform/tests/test_widget.py | 1 - plone/app/z3cform/tests/test_widgets.py | 17 ++---- plone/app/z3cform/widget.py | 2 +- plone/app/z3cform/wysiwyg/widget.py | 1 - setup.py | 72 ++++++++++++------------- 6 files changed, 44 insertions(+), 51 deletions(-) diff --git a/plone/app/z3cform/converters.py b/plone/app/z3cform/converters.py index 5cb72c2a..715b74d3 100644 --- a/plone/app/z3cform/converters.py +++ b/plone/app/z3cform/converters.py @@ -126,6 +126,7 @@ def toFieldValue(self, value): ret = tzinfo.localize(ret) return ret + @adapter(IDatetime, IDateWidget) class DateWidgetToDatetimeConverter(BaseDataConverter): """Data converter for date widget on datetime fields.""" @@ -180,6 +181,7 @@ def toFieldValue(self, value): ret = tzinfo.localize(ret) return ret + @adapter(ITime, ITimeWidget) class TimeWidgetConverter(BaseDataConverter): """Data converter for datetime fields.""" diff --git a/plone/app/z3cform/tests/test_widget.py b/plone/app/z3cform/tests/test_widget.py index 008d63e1..264d935c 100644 --- a/plone/app/z3cform/tests/test_widget.py +++ b/plone/app/z3cform/tests/test_widget.py @@ -23,7 +23,6 @@ class NoAcquisitionAware: class TestWidget(unittest.TestCase): - layer = PAZ3CForm_INTEGRATION_TESTING def setUp(self): diff --git a/plone/app/z3cform/tests/test_widgets.py b/plone/app/z3cform/tests/test_widgets.py index 180b20e0..adb19a14 100644 --- a/plone/app/z3cform/tests/test_widgets.py +++ b/plone/app/z3cform/tests/test_widgets.py @@ -265,7 +265,7 @@ def test_fieldwidget(self): def test_dateformatter(self): self.widget.value = "2022-08-17" - self.assertIn(" value=\"2022-08-17\" ", self.widget.render()) + self.assertIn(' value="2022-08-17" ', self.widget.render()) self.widget.mode = "display" self.assertEqual("8/17/22", self.widget.render()) @@ -440,7 +440,7 @@ def test_fieldwidget(self): def test_datetimeformatter(self): self.widget.value = "2022-08-17T12:00" - self.assertIn(" value=\"2022-08-17T12:00\" ", self.widget.render()) + self.assertIn(' value="2022-08-17T12:00" ', self.widget.render()) self.widget.mode = "display" self.assertEqual("8/17/22 12:00 PM", self.widget.render()) @@ -452,7 +452,9 @@ def test_datetimeformatter(self): self.assertEqual("August 17, 2022 12:00:00 PM +000", self.widget.render()) self.widget._formater_length = "full" - self.assertEqual("Wednesday, August 17, 2022 12:00:00 PM +000", self.widget.render()) + self.assertEqual( + "Wednesday, August 17, 2022 12:00:00 PM +000", self.widget.render() + ) # unknown formater length self.widget._formater_length = "foo" @@ -877,7 +879,6 @@ def test_widget_optgroup(self): class AjaxSelectWidgetTests(unittest.TestCase): - layer = UNIT_TESTING maxDiff = None @@ -1153,7 +1154,6 @@ def test_fieldwidget_sequence(self): class AjaxSelectWidgetIntegrationTests(unittest.TestCase): - layer = PAZ3CForm_INTEGRATION_TESTING def setUp(self): @@ -1234,7 +1234,6 @@ def test_widget(self): class RelatedItemsWidgetIntegrationTests(unittest.TestCase): - layer = PAZ3CForm_INTEGRATION_TESTING def setUp(self): @@ -1324,7 +1323,6 @@ class IRelationsType(Interface): class RelatedItemsWidgetTemplateIntegrationTests(unittest.TestCase): - layer = PAZ3CForm_INTEGRATION_TESTING def setUp(self): @@ -1597,7 +1595,6 @@ def _custom_field_widget(field, request): class RichTextWidgetTests(unittest.TestCase): - layer = PAZ3CForm_INTEGRATION_TESTING def setUp(self): @@ -1803,7 +1800,6 @@ def test_use_default_editor_value(self): class LinkWidgetIntegrationTests(unittest.TestCase): - layer = PAZ3CForm_INTEGRATION_TESTING def setUp(self): @@ -1956,17 +1952,14 @@ def test_link_widget__data_converter(self): class WidgetCustomizingIntegrationTests(unittest.TestCase): - layer = PAZ3CForm_INTEGRATION_TESTING def test_widget_base_wrapper_css(self): class ITestDateSchema(Schema): - widget("my_date", DateWidget, wrapper_css_class="foo") my_date = Date(title="My Date") class TestForm(AutoExtensibleForm, EditForm): - ignoreContext = True schema = ITestDateSchema diff --git a/plone/app/z3cform/widget.py b/plone/app/z3cform/widget.py index c1507a69..bb7d5e4c 100644 --- a/plone/app/z3cform/widget.py +++ b/plone/app/z3cform/widget.py @@ -139,6 +139,7 @@ class DateWidget(BaseWidget, z3cform_TextWidget): The default_timezone and default_time arguments are only used if a datewidget is used on a datetime field. If used on a date field they are ignored. """ + _base_type = "date" _converter = DateWidgetConverter _formater = "date" @@ -230,7 +231,6 @@ class DatetimeWidget(DateWidget): @implementer_only(ITimeWidget) class TimeWidget(BaseWidget, z3cform_TextWidget): - pattern = "" def _base(self, **kw): diff --git a/plone/app/z3cform/wysiwyg/widget.py b/plone/app/z3cform/wysiwyg/widget.py index 09bc9d7d..e06fa49a 100644 --- a/plone/app/z3cform/wysiwyg/widget.py +++ b/plone/app/z3cform/wysiwyg/widget.py @@ -22,7 +22,6 @@ class IWysiwygWidget(z3c.form.interfaces.ITextAreaWidget): @implementer_only(IWysiwygWidget) class WysiwygWidget(z3c.form.browser.textarea.TextAreaWidget): - klass = "kupu-widget" value = "" diff --git a/setup.py b/setup.py index 01cf5262..419eb943 100644 --- a/setup.py +++ b/setup.py @@ -8,24 +8,24 @@ def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() -version = '4.0.2.dev0' +version = "4.0.2.dev0" long_description = ( - read('README.rst') + - '\n' + - read('plone', 'app', 'z3cform', 'wysiwyg', 'README.rst') + - '\n' + - read('plone', 'app', 'z3cform', 'inline_validation.rst') + - '\n' + - read('CHANGES.rst') + - '\n' + read("README.rst") + + "\n" + + read("plone", "app", "z3cform", "wysiwyg", "README.rst") + + "\n" + + read("plone", "app", "z3cform", "inline_validation.rst") + + "\n" + + read("CHANGES.rst") + + "\n" ) setup( - name='plone.app.z3cform', + name="plone.app.z3cform", version=version, description="A collection of widgets, templates and other components " - "for use with z3c.form and Plone", + "for use with z3c.form and Plone", long_description=long_description, classifiers=[ "Development Status :: 5 - Production/Stable", @@ -42,38 +42,38 @@ def read(*rnames): "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ], - keywords='zope plone form widget template', - author='Plone Foundation', - author_email='plone-developers@lists.sourceforge.net', - url='https://pypi.org/project/plone.app.z3cform', - license='GPL', + keywords="zope plone form widget template", + author="Plone Foundation", + author_email="plone-developers@lists.sourceforge.net", + url="https://pypi.org/project/plone.app.z3cform", + license="GPL", packages=find_packages(), - namespace_packages=['plone', 'plone.app'], + namespace_packages=["plone", "plone.app"], include_package_data=True, zip_safe=False, python_requires=">=3.8", install_requires=[ - 'plone.app.textfield>=1.3.6', - 'plone.app.widgets>=2.4.2', - 'plone.base', - 'plone.protect', - 'setuptools', - 'z3c.form >= 4.0', - 'z3c.formwidget.query', - 'zope.deprecation', - 'zope.globalrequest', - 'Zope', + "plone.app.textfield>=1.3.6", + "plone.app.widgets>=2.4.2", + "plone.base", + "plone.protect", + "setuptools", + "z3c.form >= 4.0", + "z3c.formwidget.query", + "zope.deprecation", + "zope.globalrequest", + "Zope", ], extras_require={ - 'tests': [ - 'mock', - 'plone.app.robotframework', - 'plone.app.testing', - 'plone.browserlayer', - 'plone.testing', - 'zope.contentprovider', - 'zope.publisher', - 'zope.testing', + "tests": [ + "mock", + "plone.app.robotframework", + "plone.app.testing", + "plone.browserlayer", + "plone.testing", + "zope.contentprovider", + "zope.publisher", + "zope.testing", ] }, ) From 39bf540978d5ca0ed4d03adeff57ce9dd6c80554 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Thu, 16 Mar 2023 10:06:15 +0100 Subject: [PATCH 06/15] chore: zpretty ZCML --- plone/app/z3cform/configure.zcml | 56 ++++---- plone/app/z3cform/overrides.zcml | 5 +- plone/app/z3cform/profiles.zcml | 16 ++- plone/app/z3cform/tests/testing.zcml | 46 +++--- plone/app/z3cform/widget.zcml | 170 +++++++++++++---------- plone/app/z3cform/wysiwyg/configure.zcml | 11 +- 6 files changed, 170 insertions(+), 134 deletions(-) diff --git a/plone/app/z3cform/configure.zcml b/plone/app/z3cform/configure.zcml index 9c6e64c3..9bd4ec02 100644 --- a/plone/app/z3cform/configure.zcml +++ b/plone/app/z3cform/configure.zcml @@ -2,9 +2,10 @@ xmlns="http://namespaces.zope.org/zope" xmlns:browser="http://namespaces.zope.org/browser" xmlns:i18n="http://namespaces.zope.org/i18n" - xmlns:zcml="http://namespaces.zope.org/zcml" xmlns:z3c="http://namespaces.zope.org/z3c" - i18n_domain="plone"> + xmlns:zcml="http://namespaces.zope.org/zcml" + i18n_domain="plone" + > @@ -19,25 +20,25 @@ @@ -53,22 +54,22 @@ - + - + - + @@ -101,20 +108,21 @@ + provides=".interfaces.IRichTextWidgetInputModeRenderer" + name="tinymce" + component=".widget.tinymce_richtextwidget_render" + /> diff --git a/plone/app/z3cform/overrides.zcml b/plone/app/z3cform/overrides.zcml index ab5befb9..198e8b01 100644 --- a/plone/app/z3cform/overrides.zcml +++ b/plone/app/z3cform/overrides.zcml @@ -1,3 +1,6 @@ - + diff --git a/plone/app/z3cform/profiles.zcml b/plone/app/z3cform/profiles.zcml index b74de448..89613155 100644 --- a/plone/app/z3cform/profiles.zcml +++ b/plone/app/z3cform/profiles.zcml @@ -1,17 +1,19 @@ - + diff --git a/plone/app/z3cform/tests/testing.zcml b/plone/app/z3cform/tests/testing.zcml index 22c27be3..f706b0c0 100644 --- a/plone/app/z3cform/tests/testing.zcml +++ b/plone/app/z3cform/tests/testing.zcml @@ -2,30 +2,34 @@ xmlns="http://namespaces.zope.org/zope" xmlns:browser="http://namespaces.zope.org/browser" xmlns:i18n="http://namespaces.zope.org/i18n" - i18n_domain="plone"> + i18n_domain="plone" + > - + - + - + - + diff --git a/plone/app/z3cform/widget.zcml b/plone/app/z3cform/widget.zcml index 3e61eef8..ed453f03 100644 --- a/plone/app/z3cform/widget.zcml +++ b/plone/app/z3cform/widget.zcml @@ -1,7 +1,8 @@ + i18n_domain="plone" + > @@ -55,81 +56,84 @@ for="zope.schema.interfaces.IBool .interfaces.IPloneFormLayer" /> - + - + + plone.app.z3cform.interfaces.IPloneFormLayer" + /> - + - + - + - + - + - + - + - + + layer=".interfaces.IPloneFormLayer" + mode="input" + /> diff --git a/plone/app/z3cform/wysiwyg/configure.zcml b/plone/app/z3cform/wysiwyg/configure.zcml index ed277d61..cc414bde 100644 --- a/plone/app/z3cform/wysiwyg/configure.zcml +++ b/plone/app/z3cform/wysiwyg/configure.zcml @@ -1,7 +1,8 @@ + i18n_domain="plone" + > From 491553af595b8192529e78db67dd2b06e6342129 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Thu, 16 Mar 2023 10:10:09 +0100 Subject: [PATCH 07/15] chore: zpretty PT --- .../z3cform/profiles/default/browserlayer.xml | 5 +- .../app/z3cform/profiles/default/metadata.xml | 2 +- .../z3cform/templates/ajaxselect_display.pt | 51 ++- plone/app/z3cform/templates/checkbox_input.pt | 200 +++++---- .../templates/contentprovider-widget.pt | 7 +- plone/app/z3cform/templates/error.pt | 7 +- plone/app/z3cform/templates/file_input.pt | 257 +++++++----- plone/app/z3cform/templates/form.pt | 32 +- plone/app/z3cform/templates/image_input.pt | 259 +++++++----- plone/app/z3cform/templates/layout.pt | 26 +- plone/app/z3cform/templates/link_input.pt | 112 +++-- plone/app/z3cform/templates/macros.pt | 392 ++++++++++-------- plone/app/z3cform/templates/multi_input.pt | 187 +++++---- plone/app/z3cform/templates/object_input.pt | 92 ++-- .../z3cform/templates/orderedselect_input.pt | 255 +++++++----- plone/app/z3cform/templates/password_input.pt | 80 ++-- plone/app/z3cform/templates/radio_input.pt | 29 +- .../z3cform/templates/radio_input_single.pt | 84 ++-- .../z3cform/templates/relateditems_display.pt | 85 ++-- plone/app/z3cform/templates/select_input.pt | 103 +++-- plone/app/z3cform/templates/singlecheckbox.pt | 53 ++- .../templates/singlecheckboxbool_display.pt | 37 +- .../templates/singlecheckboxbool_hidden.pt | 78 ++-- .../templates/singlecheckboxbool_input.pt | 215 ++++++---- plone/app/z3cform/templates/submit_input.pt | 66 +-- plone/app/z3cform/templates/text_input.pt | 86 ++-- plone/app/z3cform/templates/textarea_input.pt | 74 ++-- .../templates/textfield_widget_input.pt | 149 ++++--- .../app/z3cform/templates/textlines_input.pt | 72 ++-- plone/app/z3cform/templates/widget.pt | 85 ++-- plone/app/z3cform/wysiwyg/wysiwyg_display.pt | 40 +- plone/app/z3cform/wysiwyg/wysiwyg_input.pt | 43 +- 32 files changed, 1946 insertions(+), 1317 deletions(-) diff --git a/plone/app/z3cform/profiles/default/browserlayer.xml b/plone/app/z3cform/profiles/default/browserlayer.xml index 7047ada0..e63a3c7e 100644 --- a/plone/app/z3cform/profiles/default/browserlayer.xml +++ b/plone/app/z3cform/profiles/default/browserlayer.xml @@ -1,3 +1,6 @@ + - + diff --git a/plone/app/z3cform/profiles/default/metadata.xml b/plone/app/z3cform/profiles/default/metadata.xml index a44cc349..dbfd3b42 100644 --- a/plone/app/z3cform/profiles/default/metadata.xml +++ b/plone/app/z3cform/profiles/default/metadata.xml @@ -1,4 +1,4 @@ - + 3 diff --git a/plone/app/z3cform/templates/ajaxselect_display.pt b/plone/app/z3cform/templates/ajaxselect_display.pt index c634dede..c9252807 100644 --- a/plone/app/z3cform/templates/ajaxselect_display.pt +++ b/plone/app/z3cform/templates/ajaxselect_display.pt @@ -1,26 +1,31 @@ - - - ${python:item['title']} - - + tal:omit-tag="" +> + + + ${python:item['title']} + + diff --git a/plone/app/z3cform/templates/checkbox_input.pt b/plone/app/z3cform/templates/checkbox_input.pt index 56efa26f..81585fe2 100644 --- a/plone/app/z3cform/templates/checkbox_input.pt +++ b/plone/app/z3cform/templates/checkbox_input.pt @@ -1,81 +1,123 @@ -
-
- - -
-
- + xmlns:tal="http://xml.zope.org/namespaces/tal" + tal:define=" + items view/items; + items python:list(items); + single_checkbox python:len(items) == 1; + " + tal:omit-tag="" +> +
+
+ + +
+
+ diff --git a/plone/app/z3cform/templates/contentprovider-widget.pt b/plone/app/z3cform/templates/contentprovider-widget.pt index c1143343..537d8d11 100644 --- a/plone/app/z3cform/templates/contentprovider-widget.pt +++ b/plone/app/z3cform/templates/contentprovider-widget.pt @@ -1,2 +1,5 @@ - + diff --git a/plone/app/z3cform/templates/error.pt b/plone/app/z3cform/templates/error.pt index c49d8bec..6e20ea7c 100644 --- a/plone/app/z3cform/templates/error.pt +++ b/plone/app/z3cform/templates/error.pt @@ -1,5 +1,8 @@ -
Error
+ tal:omit-tag="" +> +
Error
diff --git a/plone/app/z3cform/templates/file_input.pt b/plone/app/z3cform/templates/file_input.pt index f2647c4b..58c57443 100644 --- a/plone/app/z3cform/templates/file_input.pt +++ b/plone/app/z3cform/templates/file_input.pt @@ -1,112 +1,157 @@ -
- - - - File already uploaded: +
+ + + + File already uploaded: ${view/value/filename} - - - - - Filename - - ContentType, - 100 - - -
- - -
-
- - -
-
- - -
-
+ + + + Filename + + — + ContentType, + 100 + + + +
+ + +
+
+ + +
+
+ + +
+
- + - +
diff --git a/plone/app/z3cform/templates/form.pt b/plone/app/z3cform/templates/form.pt index e4215a13..1d9fc9d4 100644 --- a/plone/app/z3cform/templates/form.pt +++ b/plone/app/z3cform/templates/form.pt @@ -1,21 +1,27 @@ - + xml:lang="en" + i18n:domain="plone" +> - -

- + +

+
- -
- + +
+
- - - + + + diff --git a/plone/app/z3cform/templates/image_input.pt b/plone/app/z3cform/templates/image_input.pt index c654fe89..b1ebb4f4 100644 --- a/plone/app/z3cform/templates/image_input.pt +++ b/plone/app/z3cform/templates/image_input.pt @@ -1,114 +1,159 @@ -
- - - - Image already uploaded: +
+ + + + Image already uploaded: ${view/value/filename} - - - - - -
- - Filename - - ContentType, - 100 -
- -
- - -
-
- - -
+ + + + +
+ + Filename + + — + ContentType, + 100 + +
+ +
+ + +
+
+ + +
-
- - -
-
+
+ + +
+
- + - +
diff --git a/plone/app/z3cform/templates/layout.pt b/plone/app/z3cform/templates/layout.pt index 5211b6c5..0bfb98be 100644 --- a/plone/app/z3cform/templates/layout.pt +++ b/plone/app/z3cform/templates/layout.pt @@ -1,18 +1,24 @@ - - + xml:lang="en" + i18n:domain="plone" +> + - -

Title

-
- + +

Title

+
+
- + diff --git a/plone/app/z3cform/templates/link_input.pt b/plone/app/z3cform/templates/link_input.pt index 1c747a34..10672186 100644 --- a/plone/app/z3cform/templates/link_input.pt +++ b/plone/app/z3cform/templates/link_input.pt @@ -2,51 +2,105 @@
+ data-pat-autotoc="section:span.linkType;levels:span.linkLabel;" + > - - Internal + + Internal
- +
- - External + + External
- - + +
-