Skip to content

Commit 6446d61

Browse files
committed
Remove spaceless filter usage
1 parent 612a0a3 commit 6446d61

File tree

7 files changed

+17
-101
lines changed

7 files changed

+17
-101
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{% if allow_add %}
2-
{% apply spaceless %}
32
<a class="btn btn-primary new">
43
<i class="fa fa-plus"></i>
54
{{- ' ' ~ 's2a_bootstrap_collection.add'|trans({}, 'AdmingeneratorFormExtensions') -}}
65
</a>
7-
{% endapply %}
86
{% endif %}
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{% if allow_delete %}
2-
{% apply spaceless %}
32
<a class="btn btn-danger batch-delete">
43
<i class="fa fa-trash-can fa-regular"></i>
54
{{- ' ' ~ 's2a_bootstrap_collection.delete'|trans({}, 'AdmingeneratorFormExtensions') -}}
65
</a>
76
<label class="btn btn-link btn-toggle input-append">
87
<input type="checkbox" name="toggle">
98
</label>
10-
{% endapply %}
119
{% endif %}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{% if allow_delete %}
2-
{% apply spaceless %}
32
<div class="collection-item-actions {{ id ~ '_actions' }}">
43
<label class="btn btn-link btn-toggle input-append">
54
<input type="checkbox" name="delete" value="1">
@@ -8,5 +7,4 @@
87
<i class="fa fa-times"></i>
98
</a>
109
</div>
11-
{% endapply %}
1210
{% endif %}
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
{% macro bytesToSize(bytes) %}
2-
{% apply spaceless %}
32
{% set kilobyte = 1000 %}
43
{% set megabyte = kilobyte * 1000 %}
54
{% set gigabyte = megabyte * 1000 %}
65
{% set terabyte = gigabyte * 1000 %}
76
{% set petabyte = terabyte * 1000 %}
87

98
{% if bytes < kilobyte %}
10-
{{ bytes ~ ' B' }}
9+
{{- bytes ~ ' B' -}}
1110
{% elseif bytes < megabyte %}
12-
{{ (bytes / kilobyte)|number_format(2, '.') ~ ' KB' }}
11+
{{- (bytes / kilobyte)|number_format(2, '.') ~ ' KB' -}}
1312
{% elseif bytes < gigabyte %}
14-
{{ (bytes / megabyte)|number_format(2, '.') ~ ' MB' }}
13+
{{- (bytes / megabyte)|number_format(2, '.') ~ ' MB' -}}
1514
{% elseif bytes < terabyte %}
16-
{{ (bytes / gigabyte)|number_format(2, '.') ~ ' GB' }}
15+
{{- (bytes / gigabyte)|number_format(2, '.') ~ ' GB' -}}
1716
{% elseif bytes < petabyte %}
18-
{{ (bytes / terabyte)|number_format(2, '.') ~ ' TB' }}
17+
{{- (bytes / terabyte)|number_format(2, '.') ~ ' TB' -}}
1918
{% else %}
20-
{{ (bytes / petabyte)|number_format(2, '.') ~ ' PB' }}
19+
{{- (bytes / petabyte)|number_format(2, '.') ~ ' PB' -}}
2120
{% endif %}
22-
{% endapply %}
2321
{% endmacro %}
+4-12
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
{% block s2a_collection_fieldset_css %}
2-
{% apply spaceless %}
3-
{% include "@AdmingeneratorFormExtensions/Form/BootstrapCollection/stylesheet.html.twig" %}
4-
{% endapply %}
2+
{%- include "@AdmingeneratorFormExtensions/Form/BootstrapCollection/stylesheet.html.twig" -%}
53
{% endblock s2a_collection_fieldset_css %}
64

75
{% block s2a_collection_table_css %}
8-
{% apply spaceless %}
9-
{% include "@AdmingeneratorFormExtensions/Form/BootstrapCollection/stylesheet.html.twig" %}
10-
{% endapply %}
6+
{%- include "@AdmingeneratorFormExtensions/Form/BootstrapCollection/stylesheet.html.twig" -%}
117
{% endblock s2a_collection_table_css %}
128

139
{% block s2a_collection_upload_css %}
14-
{% apply spaceless %}
15-
{% include "@AdmingeneratorFormExtensions/Form/UploadCollection/stylesheet.html.twig" %}
16-
{% endapply %}
10+
{%- include "@AdmingeneratorFormExtensions/Form/UploadCollection/stylesheet.html.twig" -%}
1711
{% endblock s2a_collection_upload_css %}
1812

1913
{% block s2a_google_map_css %}
20-
{% apply spaceless %}
21-
{% include "@AdmingeneratorFormExtensions/Form/GoogleMap/stylesheet.html.twig" %}
22-
{% endapply %}
14+
{%- include "@AdmingeneratorFormExtensions/Form/GoogleMap/stylesheet.html.twig" -%}
2315
{% endblock s2a_google_map_css %}
2416

Resources/views/Form/form_html.html.twig

+7-35
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
11
{% block form_row %}
2-
{% apply spaceless %}
32
<div class="control-group control-group-{{ name }}{% if errors|length > 0 %} has-error{% endif %}">
43
{{ form_label(form) }}
54
{{ form_widget(form) }}
65
{{ form_errors(form) }}
76
{{ block('form_help') }}
87
</div>
9-
{% endapply %}
108
{% endblock form_row %}
119

1210
{% block form_help %}
13-
{% apply spaceless %}
14-
{% if help %}
11+
{%- if help -%}
1512
<span class="help-block">
1613
<p class="muted">{{ help|trans({}, translation_domain) }}</p>
1714
</span>
18-
{% endif %}
19-
{% endapply %}
15+
{%- endif -%}
2016
{% endblock form_help %}
2117

2218
{% block s2a_collection_fieldset_widget %}
23-
{% apply spaceless %}
24-
{% if prototype is defined %}
19+
{%- if prototype is defined %}
2520
{% set item = prototype %}
2621
{% set attr = attr|merge({'data-prototype': block('s2a_collection_fieldset_item') }) %}
2722
{% endif %}
28-
{% set attr = attr|merge({'class': 'control-group' }) %}
23+
{% set attr = attr|merge({'class': 'control-group' }) -%}
2924
<div {{ block('widget_container_attributes') }}>
3025
<div id="{{ id ~ '_toolbar' }}" class="btn-toolbar form-actions form-actions-condensed">
3126
{%- include "@AdmingeneratorFormExtensions/Form/BootstrapCollection/collection_add.html.twig" -%}
@@ -39,7 +34,6 @@
3934
<div class="clearfix"></div>
4035
{{ form_rest(form) }}
4136
</div>
42-
{% endapply %}
4337
{% endblock s2a_collection_fieldset_widget %}
4438

4539
{% block s2a_collection_fieldset_item %}
@@ -54,7 +48,6 @@
5448
{% endblock s2a_collection_fieldset_item %}
5549

5650
{% block s2a_collection_table_widget %}
57-
{% apply spaceless %}
5851
{% if prototype is defined %}
5952
{% set item = prototype %}
6053
{% set attr = attr|merge({'data-prototype': block('s2a_collection_table_item') }) %}
@@ -75,7 +68,6 @@
7568
{% endfor %}
7669
</tbody>
7770
</table>
78-
{% endapply %}
7971
{% endblock s2a_collection_table_widget %}
8072

8173
{% block s2a_collection_table_item %}
@@ -119,7 +111,6 @@
119111
{% endblock s2a_collection_table_item %}
120112

121113
{% block s2a_upload_collection_widget %}
122-
{% apply spaceless %}
123114
{% set original_full_name = full_name %}
124115
{% set full_name = full_name ~ '[uploads][]' %}
125116
<div id="{{ id ~ '_widget_container' }}">
@@ -164,11 +155,9 @@
164155
{% include "@AdmingeneratorFormExtensions/Form/UploadCollection/template_upload.html.twig" %}
165156
{% endif %}
166157
</div>
167-
{% endapply %}
168158
{% endblock s2a_upload_collection_widget %}
169159

170160
{% block s2a_double_list_prototype %}
171-
{% apply spaceless %}
172161
<div id="{{ id ~ '_widget_container' }}" class="double-list">
173162
<div class="col-xs-12 col-sm-5 list-unselected dropdown open">
174163
{% include "@AdmingeneratorFormExtensions/Form/DoubleList/unselected_list.html.twig" %}
@@ -181,7 +170,6 @@
181170
</div>
182171
{{ block('choice_widget') }}
183172
</div>
184-
{% endapply %}
185173
{% endblock s2a_double_list_prototype %}
186174

187175
{% block s2a_double_list_document_widget %}
@@ -197,7 +185,6 @@
197185
{% endblock s2a_double_list_model_widget %}
198186

199187
{% block s2a_single_upload_widget %}
200-
{% apply spaceless %}
201188
<div id="{{ id ~ '_widget_container' }}" class="single-upload">
202189
<div class="btn-toolbar form-actions form-actions-condensed singleupload-buttonbar">
203190
<span class="btn btn-success fileinput">
@@ -210,7 +197,6 @@
210197
{% include "@AdmingeneratorFormExtensions/Form/SingleUpload/preview.html.twig" %}
211198
</div>
212199
</div>
213-
{% endapply %}
214200
{% endblock s2a_single_upload_widget %}
215201

216202
{% block s2a_select2_choice_widget %}
@@ -246,7 +232,6 @@
246232
{% endblock %}
247233

248234
{% block s2a_datetime_family_prototype %}
249-
{% apply spaceless %}
250235
<input id="{{ id }}" name="{{ full_name }}" type="hidden" value="{{ value }}" />
251236
<div id="{{ id ~ '_widget' }}" class="s2a-date" {% if width is defined and width is not null %}style="width: {{ width }}px"{% endif %}>
252237
<input {{ block('s2a_datetime_family_widget_attributes') }} />
@@ -257,7 +242,6 @@
257242
<i class="{{ widgetIcon }}"></i>
258243
</a>
259244
</div>
260-
{% endapply %}
261245
{% endblock s2a_datetime_family_prototype %}
262246

263247
{% block s2a_datetime_family_widget_attributes -%}
@@ -280,28 +264,21 @@
280264
{%- endblock s2a_datetime_family_widget_attributes %}
281265

282266
{% block s2a_datetime_picker_widget %}
283-
{% apply spaceless %}
284267
{% set widgetIcon = 'fa-regular fa-calendar-days' %}
285268
{{ block('s2a_datetime_family_prototype') }}
286-
{% endapply %}
287269
{% endblock s2a_datetime_picker_widget %}
288270

289271
{% block s2a_date_picker_widget %}
290-
{% apply spaceless %}
291272
{% set widgetIcon = 'fa-regular fa-calendar-days' %}
292273
{{ block('s2a_datetime_family_prototype') }}
293-
{% endapply %}
294274
{% endblock s2a_date_picker_widget %}
295275

296276
{% block s2a_time_picker_widget %}
297-
{% apply spaceless %}
298277
{% set widgetIcon = 'fa-regular fa-clock' %}
299278
{{ block('s2a_datetime_family_prototype') }}
300-
{% endapply %}
301279
{% endblock s2a_time_picker_widget %}
302280

303281
{% block s2a_google_map_widget %}
304-
{% apply spaceless %}
305282
<div {{ block('widget_container_attributes') }}>
306283
<div id="{{ id }}_container">
307284
<div class="input-group">
@@ -323,23 +300,18 @@
323300
{{ form_row(child) }}
324301
{% endfor %}
325302
</div>
326-
{% endapply %}
327303
{% endblock s2a_google_map_widget %}
328304

329305
{% block s2a_money_widget %}
330-
{% apply spaceless %}
331306
<div class="input-group">
332307
<span class="input-group-addon">{{ money_pattern|replace({ '{{ widget }}': '' })|raw }}</span>
333308
{{ block('form_widget_simple')|raw }}
334309
</div>
335-
{% endapply %}
336310
{% endblock %}
337311

338312
{% block s2a_daterange_picker_widget %}
339-
{% apply spaceless %}
340-
<div class="input-group">
341-
<span class="input-group-addon"><i class="fa fa-calendar-days fa-regular fa-fw"></i></span>
313+
<div class="input-group">
314+
<span class="input-group-addon"><i class="fa fa-calendar-days fa-regular fa-fw"></i></span>
342315
{{ block('form_widget_simple') }}
343-
</div>
344-
{% endapply %}
316+
</div>
345317
{% endblock s2a_daterange_picker_widget %}

0 commit comments

Comments
 (0)