Skip to content

Commit

Permalink
Merge 31cd83a into c8cd44b
Browse files Browse the repository at this point in the history
  • Loading branch information
gbastien committed Sep 13, 2018
2 parents c8cd44b + 31cd83a commit e1fe63e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Expand Up @@ -4,8 +4,8 @@ Changelog
1.3.1 (unreleased)
------------------

- Nothing changed yet.

- Display column description if provided in schema `field.description`.
[gbastien, bleybaert]

1.3.0.post1 (2018-07-16)
------------------------
Expand Down
6 changes: 6 additions & 0 deletions src/collective/z3cform/datagridfield/browser.rst
Expand Up @@ -60,6 +60,12 @@ Make sure the delete row button is present (x4)
>>> browser.contents.find('<td class="datagridwidget-manipulator delete-row">') != -1
True

Make sure the description is displayed in the 'personCount' column header

>>> browser.contents.find('<span>Persons</span>\n \n <span class="formHelp">Enter number of persons (min 0 and max 15)</span>') != -1
True


Make sure resources from our package are not using absolute URLs. If absolute
URLs are present, then the resources won't load on anything except where
Plone/Zope are the root of the domain.
Expand Down
1 change: 1 addition & 0 deletions src/collective/z3cform/datagridfield/datagridfield.py
Expand Up @@ -97,6 +97,7 @@ def field(self, value):
col = {
'name': name,
'label': field.title,
'description': field.description,
'required': field.required,
'mode': fieldmodes.get(name, None),
}
Expand Down
Expand Up @@ -17,6 +17,7 @@
tal:content="column/label">title</span>
<span class="required"
tal:condition="column/required" title="Required" i18n:domain="plone" i18n:attributes="title title_required">&nbsp;</span>
<span class="formHelp" tal:condition="column/description" tal:content="column/description">Description</span>
</th>
</tal:block>
<th id="" class="header" tal:condition="view/allow_insert"> </th>
Expand Down
7 changes: 6 additions & 1 deletion src/collective/z3cform/datagridfield/demo/editform_simple.py
Expand Up @@ -62,7 +62,12 @@ class IAddress(Interface):
title=u'Don\'t change', readonly=True, required=True)

# A sample integer field
personCount = schema.Int(title=u'Persons', required=False, min=0, max=15)
personCount = schema.Int(
title=u'Persons',
description=u'Enter number of persons (min 0 and max 15)',
required=False,
min=0,
max=15)

# A sample datetime field
if widget_datetime is not None:
Expand Down

0 comments on commit e1fe63e

Please sign in to comment.