Fix the money form type render with Bootstrap3

There is a confusion between the variable naming, and the result expected.

When prepend variable is false, the currency symbol must be add after the widget.
When the money_patternstarts with {{, prepend variable must be false.
This commit is contained in:
Jérémy Marodon 2016-07-25 15:48:42 +02:00
parent 37cd583e78
commit 637a4411d7

View File

@ -21,12 +21,12 @@
{% block money_widget -%}
<div class="input-group">
{% set prepend = '{{' == money_pattern[0:2] %}
{% if not prepend %}
{% set append = money_pattern starts with '{{' %}
{% if not append %}
<span class="input-group-addon">{{ money_pattern|replace({ '{{ widget }}':''}) }}</span>
{% endif %}
{{- block('form_widget_simple') -}}
{% if prepend %}
{% if append %}
<span class="input-group-addon">{{ money_pattern|replace({ '{{ widget }}':''}) }}</span>
{% endif %}
</div>