Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deform2: Fix “input groups” for bs3 #189

Merged
merged 1 commit into from
Oct 4, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 21 additions & 22 deletions deform/templates/mapping_item.pt
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,28 @@
</label>

<div tal:define="input_prepend field.widget.input_prepend | None;
input_append field.widget.input_append | None;
prepend_class input_prepend and 'input-prepend' or '';
append_class input_append and 'input-append' or ''"
input_append field.widget.input_append | None"
tal:omit-tag="not (input_prepend or input_append)"
class="${prepend_class + ' ' + append_class}">

<span class="add-on" tal:condition="input_prepend">${input_prepend}</span>
<span tal:replace="structure field.serialize(cstruct)" />
<span class="add-on" tal:condition="input_append">${input_append}</span>
class="input-group">
<span class="input-group-addon"
tal:condition="input_prepend">${input_prepend}</span
><span tal:replace="structure field.serialize(cstruct).strip()"
/><span class="input-group-addon"
tal:condition="input_append">${input_append}</span>
</div>

<p class="help-block"
tal:define="errstr 'error-%s' % field.oid"
tal:repeat="msg field.error.messages()"
i18n:translate=""
tal:attributes="id repeat.msg.index==0 and errstr or
('%s-%s' % (errstr, repeat.msg.index))"
tal:condition="field.error and not field.widget.hidden and not field.typ.__class__.__name__=='Mapping'">
${msg}
</p>
<p class="help-block"
tal:define="errstr 'error-%s' % field.oid"
tal:repeat="msg field.error.messages()"
i18n:translate=""
tal:attributes="id repeat.msg.index==0 and errstr or
('%s-%s' % (errstr, repeat.msg.index))"
tal:condition="field.error and not field.widget.hidden and not field.typ.__class__.__name__=='Mapping'">
${msg}
</p>

<p tal:condition="field.description and not field.widget.hidden"
class="help-block" >
${field.description}
</p>
</div>
<p tal:condition="field.description and not field.widget.hidden"
class="help-block" >
${field.description}
</p>
</div>