Skip to content

Commit

Permalink
Merge branch 'master' into saved-data-batch-size
Browse files Browse the repository at this point in the history
These are the autofocus changes.
  • Loading branch information
mauritsvanrees committed Dec 13, 2024
2 parents 6332f68 + 4bbeeeb commit 4099fc9
Show file tree
Hide file tree
Showing 16 changed files with 559 additions and 453 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Changelog
- Pin version `Products.validation>=3.0.0`
[petschki]

- Add a checkbox to disable autofocus on the first input
[yurj]


4.2.1 (2024-10-08)
------------------
Expand Down
28 changes: 10 additions & 18 deletions src/collective/easyform/browser/model_listing.pt
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@
>
<body>
<metal:block fill-slot="content">
<div id="edit-bar"
tal:define="
context nocall:context/aq_parent;
"
tal:content="structure provider:plone.contentviews"
tal:on-error="nothing"
></div>
<div metal:use-macro="context/global_statusmessage/macros/portal_message">
Status message
</div>
<div id="content">
<h1 class="documentFirstHeading"
tal:content="view/label | nothing"
></h1>
<div id="content-core">
<span tal:replace="structure view/contents"></span>
</div>
</div>
<metal:content metal:define-macro="content">
<article id="content">
<h1 class="documentFirstHeading"
tal:content="view/label | nothing"
></h1>
<div id="content-core">
<span tal:replace="structure view/contents"></span>
</div>
</article>
</metal:content>
</metal:block>
</body>
</html>
12 changes: 6 additions & 6 deletions src/collective/easyform/browser/modeleditor.pt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
>

<body>
<metal:main fill-slot="content">
<tal:main-macro metal:define-macro="content">
<div id="content">
<metal:block fill-slot="content">
<metal:content metal:define-macro="content">
<article id="content">
<style type="text/css"
tal:content="string:@import url(${portal_url}/++resource++plone.app.dexterity.modeleditor.css);"
></style>
Expand Down Expand Up @@ -56,8 +56,8 @@
</form>
</div>

</div>
</tal:main-macro>
</metal:main>
</article>
</metal:content>
</metal:block>
</body>
</html>
4 changes: 4 additions & 0 deletions src/collective/easyform/browser/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ def action(self):
def enable_form_tabbing(self):
return self.context.form_tabbing

@property
def enable_autofocus(self):
return self.context.autofocus

@property
def enable_unload_protection(self):
return self.context.unload_protection
Expand Down
8 changes: 8 additions & 0 deletions src/collective/easyform/interfaces/easyform.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class IEasyForm(Schema):
"useCancelButton",
"resetLabel",
"form_tabbing",
"autofocus",
"nameAttribute",
"default_fieldset_label",
"method",
Expand Down Expand Up @@ -242,6 +243,13 @@ class IEasyForm(Schema):
default=True,
required=False,
)
directives.write_permission(autofocus=config.EDIT_ADVANCED_PERMISSION)
autofocus = zope.schema.Bool(
title=_(u"label_autofocus", default=u"Enable focus on the first input"),
description=_(u"help_autofocus", default=u""),
default=True,
required=False,
)
directives.write_permission(default_fieldset_label=config.EDIT_ADVANCED_PERMISSION)
default_fieldset_label = zope.schema.TextLine(
title=_(
Expand Down
Loading

0 comments on commit 4099fc9

Please sign in to comment.