Skip to content

Commit

Permalink
Merge pull request #552 from gisweb/github-main
Browse files Browse the repository at this point in the history
Fixed error in inserting plominoFieldClass of fields with no widget choice
  • Loading branch information
manuelep committed Apr 8, 2014
2 parents e8f0534 + 22e93bc commit 4ead47e
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions Products/CMFPlomino/PlominoForm.py
Expand Up @@ -567,30 +567,30 @@ def _handleLabels(self, html_content_orig, editmode):
field_re = re.compile('<span class="plominoFieldClass">%s</span>' % fn)
match_field = field_re.search(html_content_processed)
field_type = field.getFieldType()
widget_name = field.getSettings().widget

# Handle input groups:
if (field_type in ['DATETIME', 'SELECTION'] and
widget_name in ['CHECKBOX', 'RADIO', 'PICKLIST', 'SERVER']):
# Delete processed label
html_content_processed = label_re.sub('', html_content_processed, count=1)
# Is the field in the layout?
if match_field:
# Markup the field
if editmode:
mandatory = (
field.getMandatory()
and " class='required'"
or '')
html_content_processed = field_re.sub(
"<fieldset><legend%s>%s</legend>%s</fieldset>" % (
mandatory, label, match_field.group()),
html_content_processed)
else:
html_content_processed = field_re.sub(
"<div class='fieldset'><span class='legend' title='Legend for %s'>%s</span>%s</div>" % (
fn, label, match_field.group()),
html_content_processed)
if field_type in ['DATETIME', 'SELECTION']:
widget_name = field.getSettings().widget
if widget_name in ['CHECKBOX', 'RADIO', 'PICKLIST', 'SERVER']:
# Delete processed label
html_content_processed = label_re.sub('', html_content_processed, count=1)
# Is the field in the layout?
if match_field:
# Markup the field
if editmode:
mandatory = (
field.getMandatory()
and " class='required'"
or '')
html_content_processed = field_re.sub(
"<fieldset><legend%s>%s</legend>%s</fieldset>" % (
mandatory, label, match_field.group()),
html_content_processed)
else:
html_content_processed = field_re.sub(
"<div class='fieldset'><span class='legend' title='Legend for %s'>%s</span>%s</div>" % (
fn, label, match_field.group()),
html_content_processed)

# Handle single inputs:
else:
Expand Down

0 comments on commit 4ead47e

Please sign in to comment.