|
11 | 11 | {% endblock textarea_widget %} |
12 | 12 |
|
13 | 13 | {% block form_widget_simple %} |
14 | | - {% apply spaceless %} |
15 | | - {% set attr = attr|merge({'class': attr.class|default('') ~ ' form-control'}) %} |
16 | | - {% set type = type|default('text') %} |
| 14 | + {% set attr = attr|merge({'class': attr.class|default('') ~ ' form-control'}) %} |
| 15 | + {% set type = type|default('text') %} |
17 | 16 |
|
18 | | - {% if 'file' == type %} |
19 | | - <span class="btn--primary btn-lg file-overlay"><i |
20 | | - class="icon-folder-open"></i> {{ 'sylius.form.choose_file'|trans }}</span> |
21 | | - {% endif %} |
22 | | - {{ parent() }} |
23 | | - {% endapply %} |
| 17 | + {%- if 'file' == type -%} |
| 18 | + <span class="btn--primary btn-lg file-overlay"><i |
| 19 | + class="icon-folder-open"></i> {{ 'sylius.form.choose_file'|trans }}</span> |
| 20 | + {%- endif -%} |
| 21 | + {{ parent() }} |
24 | 22 | {% endblock form_widget_simple %} |
25 | 23 |
|
26 | 24 | {% block form_label %} |
27 | | - {% apply spaceless %} |
28 | | - {% set label_attr = label_attr|merge({'class': label_attr.class|default('col-lg-2') ~ ' control-label'}) %} |
29 | | - {{ parent() }} |
30 | | - {% endapply %} |
| 25 | + {% set label_attr = label_attr|merge({'class': label_attr.class|default('col-lg-2') ~ ' control-label'}) %} |
| 26 | + {{ parent() }} |
31 | 27 | {% endblock form_label %} |
32 | 28 |
|
33 | 29 | {% block money_widget %} |
34 | | - {% apply spaceless %} |
35 | | - <div class="input-group"> |
36 | | - <span class="input-group-addon">{{ money_pattern|replace({'{{ widget }}': ''}) }}</span> |
37 | | - {{ block('form_widget_simple') }} |
38 | | - </div> |
39 | | - {% endapply %} |
| 30 | + <div class="input-group"> |
| 31 | + <span class="input-group-addon">{{ money_pattern|replace({'{{ widget }}': ''}) }}</span> |
| 32 | + {{ block('form_widget_simple') }} |
| 33 | + </div> |
40 | 34 | {% endblock money_widget %} |
41 | 35 |
|
42 | 36 | {% block percent_widget %} |
43 | | - {% apply spaceless %} |
44 | | - <div class="input-group"> |
45 | | - <span class="input-group-addon">%</span> |
46 | | - {{ block('form_widget_simple') }} |
47 | | - </div> |
48 | | - {% endapply %} |
| 37 | + <div class="input-group"> |
| 38 | + <span class="input-group-addon">%</span> |
| 39 | + {{ block('form_widget_simple') }} |
| 40 | + </div> |
49 | 41 | {% endblock percent_widget %} |
50 | 42 |
|
51 | 43 | {% block datetime_widget %} |
52 | | - {% apply spaceless %} |
53 | | - {% if widget == 'single_text' %} |
54 | | - {{ block('form_widget_simple') }} |
55 | | - {% else %} |
56 | | - <div class="form-group"> |
57 | | - {{ form_widget(form.date) }} |
58 | | - {{ form_widget(form.time) }} |
59 | | - </div> |
60 | | - {% endif %} |
61 | | - {% endapply %} |
| 44 | + {% if widget == 'single_text' %} |
| 45 | + {{ block('form_widget_simple') }} |
| 46 | + {% else %} |
| 47 | + <div class="form-group"> |
| 48 | + {{ form_widget(form.date) }} |
| 49 | + {{ form_widget(form.time) }} |
| 50 | + </div> |
| 51 | + {% endif %} |
62 | 52 | {% endblock datetime_widget %} |
63 | 53 |
|
64 | 54 | {% block date_widget %} |
65 | | - {% apply spaceless %} |
66 | | - {% if widget == 'single_text' %} |
67 | | - {{ block('form_widget_simple') }} |
68 | | - {% else %} |
69 | | - {{ '{{ year }} / {{ month }} / {{ day }}'|replace({ |
70 | | - '{{ year }}': form_widget(form.year, {'attr': {'style': 'display: inline; width: 100px;'}}), |
71 | | - '{{ month }}': form_widget(form.month, {'attr': {'style': 'display: inline; width: 100px;'}}), |
72 | | - '{{ day }}': form_widget(form.day, {'attr': {'style': 'display: inline; width: 100px;'}}), |
73 | | - })|raw }} |
74 | | - {% endif %} |
75 | | - {% endapply %} |
| 55 | + {% if widget == 'single_text' %} |
| 56 | + {{ block('form_widget_simple') }} |
| 57 | + {% else %} |
| 58 | + {{ '{{ year }} / {{ month }} / {{ day }}'|replace({ |
| 59 | + '{{ year }}': form_widget(form.year, {'attr': {'style': 'display: inline; width: 100px;'}}), |
| 60 | + '{{ month }}': form_widget(form.month, {'attr': {'style': 'display: inline; width: 100px;'}}), |
| 61 | + '{{ day }}': form_widget(form.day, {'attr': {'style': 'display: inline; width: 100px;'}}), |
| 62 | + })|raw }} |
| 63 | + {% endif %} |
76 | 64 | {% endblock date_widget %} |
77 | 65 |
|
78 | 66 | {% block time_widget %} |
79 | | - {% apply spaceless %} |
80 | | - {% if widget == 'single_text' %} |
81 | | - {{ block('form_widget_simple') }} |
82 | | - {% else %} |
83 | | - {% set vars = widget == 'text' ? { 'attr': { 'size': 1, 'style': 'width: 60px; display: inline;' }} : {} %} |
84 | | - {{ form_widget(form.hour, vars) }}{% if with_minutes %}:{{ form_widget(form.minute, vars) }}{% endif %}{% if with_seconds %} {{ form_widget(form.second, vars) }}{% endif %} |
85 | | - {% endif %} |
86 | | - {% endapply %} |
| 67 | + {% if widget == 'single_text' %} |
| 68 | + {{ block('form_widget_simple') }} |
| 69 | + {% else %} |
| 70 | + {% set vars = widget == 'text' ? { 'attr': { 'size': 1, 'style': 'width: 60px; display: inline;' }} : {} %} |
| 71 | + {{ form_widget(form.hour, vars) }}{% if with_minutes %}:{{ form_widget(form.minute, vars) }}{% endif %}{% if with_seconds %} {{ form_widget(form.second, vars) }}{% endif %} |
| 72 | + {% endif %} |
87 | 73 | {% endblock time_widget %} |
88 | 74 |
|
89 | 75 | {% block form_row %} |
90 | | - {% apply spaceless %} |
91 | | - <div class="form-group{% if errors|length > 0 %} has-error{% endif %}"> |
92 | | - {{ form_label(form) }} |
93 | | - <div class="col-lg-10"> |
94 | | - {{ form_widget(form) }} |
95 | | - {% for error in errors %} |
96 | | - <span class="help-block form-error"> |
97 | | - {{ error.messagePluralization is null |
98 | | - ? error.messageTemplate|trans(error.messageParameters, 'validators') |
99 | | - : error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators') }} |
100 | | - </span> |
101 | | - {% endfor %} |
102 | | - </div> |
| 76 | + <div class="form-group{% if errors|length > 0 %} has-error{% endif %}"> |
| 77 | + {{ form_label(form) }} |
| 78 | + <div class="col-lg-10"> |
| 79 | + {{ form_widget(form) }} |
| 80 | + {% for error in errors %} |
| 81 | + <span class="help-block form-error"> |
| 82 | + {{ error.messagePluralization is null |
| 83 | + ? error.messageTemplate|trans(error.messageParameters, 'validators') |
| 84 | + : error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators') }} |
| 85 | + </span> |
| 86 | + {% endfor %} |
103 | 87 | </div> |
104 | | - {% endapply %} |
| 88 | + </div> |
105 | 89 | {% endblock form_row %} |
106 | 90 |
|
107 | 91 | {% block sonata_media_type_widget %} |
|
0 commit comments