Skip to content

Commit b2816db

Browse files
committed
Fix coding standard issues for Twig files
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 6141990 commit b2816db

37 files changed

Lines changed: 52 additions & 56 deletions

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ indent_size = 4
1313
[{*.{sql,scss,css,twig,yml},package.json}]
1414
indent_size = 2
1515

16-
[*.twig]
17-
insert_final_newline = false
18-
1916
[*.svg]
2017
insert_final_newline = false
2118

templates/base.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{- header|raw -}}{{- content|raw -}}{{- footer|raw -}}
1+
{{- header|raw -}}{{- content|raw -}}{{- footer|raw -}}

templates/columns_definitions/column_attributes.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
{{- column_meta['Field'] is defined
222222
and mime_map[column_meta['Field']]['transformation'] is defined
223223
and mime_map[column_meta['Field']]['transformation'] is not null
224-
and mime_map[column_meta['Field']]['transformation'] matches '@' ~ available_mime['transformation_file_quoted'][mimekey] ~ '3?@i' ? ' selected'}}>
224+
and mime_map[column_meta['Field']]['transformation'] matches '@' ~ available_mime['transformation_file_quoted'][mimekey] ~ '3?@i' ? ' selected' }}>
225225
{{ get_name(available_mime['transformation_file'][mimekey]) ~ ' (' ~ parts[0]|lower ~ ':' ~ parts[1] ~ ')' }}
226226
</option>
227227
{% endfor %}

templates/columns_definitions/column_definitions_form.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
'content_cells': content_cells,
5454
'change_column': change_column,
5555
'is_virtual_columns_supported': is_virtual_columns_supported,
56-
'server_version' : server_version,
56+
'server_version': server_version,
5757
'browse_mime': browse_mime,
5858
'supports_stored_keyword': supports_stored_keyword,
5959
'max_rows': max_rows,

templates/config/form_display/input.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<select name="{{ path }}" id="{{ path }}" class="w-75{{ not value_is_default ? (has_errors ? ' custom field-error' : ' custom') }}">
4141
{% for key, val in select_values %}
4242
{% if val is same as(true) %}{% set val = 'Yes'|trans %}{% elseif val is same as(false) %}{% set val = 'No'|trans %}{% endif %}
43-
<option value="{{ key }}"{{ val is empty ? ' label="' ~ 'None'|trans ~ '"'}}{{ key is same as(value) or (value is same as(true) and key is same as(1)) or (value is same as(false) and key is same as(0)) ? ' selected' }}{{ key in select_values_disabled ? ' disabled' }}>{{ val }}</option>
43+
<option value="{{ key }}"{{ val is empty ? ' label="' ~ 'None'|trans ~ '"' }}{{ key is same as(value) or (value is same as(true) and key is same as(1)) or (value is same as(false) and key is same as(0)) ? ' selected' }}{{ key in select_values_disabled ? ' disabled' }}>{{ val }}</option>
4444
{% endfor %}
4545
</select>
4646
{% elseif type == 'list' %}

templates/database/central_columns/main.twig

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<a href="#">
44
<span>{{ (total_rows > 0) ? '+' : '-' }}</span>{% trans 'Add new column' %}
55
</a>
6-
<form id="add_new" class="new_central_col{{ (total_rows != 0) ? ' hide' : ''}}"
6+
<form id="add_new" class="new_central_col{{ (total_rows != 0) ? ' hide' : '' }}"
77
method="post" action="{{ url('/database/central-columns') }}">
88
{{ get_hidden_inputs(db) }}
99
<input type="hidden" name="add_new_column" value="add_new_column">
@@ -147,7 +147,7 @@
147147
<form action="{{ url('/database/central-columns') }}" method="post">
148148
{{ get_hidden_inputs(db) }}
149149
<input type="hidden" name="total_rows" value="{{ total_rows }}">
150-
{{ tn_page_selector | raw }}
150+
{{ tn_page_selector|raw }}
151151
</form>
152152
</td>
153153
{% endif %}
@@ -181,9 +181,9 @@
181181
<tr>
182182
<td class="navigation_separator largescreenonly"></td>
183183
<td class="central_columns_navigation">
184-
{{ get_icon('centralColumns_add', 'Add column' | trans)|raw }}
184+
{{ get_icon('centralColumns_add', 'Add column'|trans)|raw }}
185185
<form id="add_column" action="{{ url('/database/central-columns') }}" method="post">
186-
{{ get_hidden_inputs(db) | raw }}
186+
{{ get_hidden_inputs(db)|raw }}
187187
<input type="hidden" name="add_column" value="add">
188188
<input type="hidden" name="pos" value="{{ pos }}">
189189
<input type="hidden" name="total_rows" value="{{ total_rows }}">
@@ -216,7 +216,7 @@
216216
<form name="tableslistcontainer">
217217
<table id="table_columns" class="table table-striped table-hover tablesorter w-auto">
218218
{% set class = 'column_heading' %}
219-
{% set title = 'Click to sort.' | trans %}
219+
{% set title = 'Click to sort.'|trans %}
220220
<thead>
221221
<tr>
222222
<th class="{{ class }}"></th>
@@ -268,13 +268,13 @@
268268
value="{{ row['col_name'] }}" id="{{ 'checkbox_row_' ~ row_num }}">
269269
</td>
270270
<td id="{{ 'edit_' ~ row_num }}" class="edit text-center">
271-
<a href="#"> {{ get_icon('b_edit', 'Edit' | trans) | raw }}</a>
271+
<a href="#"> {{ get_icon('b_edit', 'Edit'|trans)|raw }}</a>
272272
</td>
273273
<td class="del_row" data-rownum = "{{ row_num }}">
274-
<a href="#">{{ get_icon('b_drop', 'Delete' | trans) }}</a>
274+
<a href="#">{{ get_icon('b_drop', 'Delete'|trans) }}</a>
275275
<input type="submit" data-rownum = "{{ row_num }}" class="btn btn-secondary edit_cancel_form" value="{{ 'Cancel'|trans }}">
276276
</td>
277-
<td id="{{ 'save_' ~ row_num }}" class="hide">
277+
<td id="{{ 'save_' ~ row_num }}" class="hide">
278278
<input type="submit" data-rownum="{{ row_num }}" class="btn btn-primary edit_save_form" value="{{ 'Save'|trans }}">
279279
</td>
280280
<td name="col_name" class="text-nowrap">
@@ -298,7 +298,7 @@
298298
</select>
299299
</td>
300300
<td class="text-nowrap" name="col_length">
301-
<span>{{ (row['col_length']?(row['col_length']):'') }}</span>
301+
<span>{{ (row['col_length'] ? (row['col_length']) : '') }}</span>
302302
<input id="field_{{ row_num }}_2" type="text" name="field_length[{{ row_num }}]" size="8" value="{{ row['col_length'] }}" class="textfield">
303303
<p class="enum_notice" id="enum_notice_{{ row_num }}_2">
304304
<a href="#" class="open_enum_editor">{% trans 'Edit ENUM/SET values' %}</a>
@@ -347,7 +347,7 @@
347347
</select>
348348
</td>
349349
<td class="text-nowrap" name="col_attribute">
350-
<span>{{ row['col_attribute']?(row['col_attribute']):"" }}</span>
350+
<span>{{ row['col_attribute'] ? (row['col_attribute']) : "" }}</span>
351351
{% include 'columns_definitions/column_attribute.twig' with {
352352
'column_number': row_num,
353353
'ci': 5,
@@ -359,7 +359,7 @@
359359
} only %}
360360
</td>
361361
<td class="text-nowrap" name="col_isNull">
362-
<span>{{ row['col_isNull'] ? 'Yes' | trans : 'No' | trans }}</span>
362+
<span>{{ row['col_isNull'] ? 'Yes'|trans : 'No'|trans }}</span>
363363
<input name="field_null[{{ row_num }}]" id="field_{{ row_num }}_6" type="checkbox" value="YES" class="allow_null"
364364
{{- row['col_isNull'] is not empty and row['col_isNull'] != 'NO' and row['col_isNull'] != 'NOT NULL' ? ' checked' }}>
365365
</td>

templates/database/designer/database_tables.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
table_name="{{ table_name }}"
112112
col_name="{{ col_name }}"
113113
db_table_name_url="{{ t_n_url }}">
114-
<img src="{{ image('designer/exec_small.png') }}" title="{% trans 'Options' %}" />
114+
<img src="{{ image('designer/exec_small.png') }}" title="{% trans 'Options' %}" />
115115
</td>
116116
{% endif %}
117117
</tr>

templates/database/privileges/index.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
</div>
109109

110110
<div>
111-
{{ get_image('select_all_arrow', 'With selected:'|trans, { 'dir': text_dir, 'width': '38', 'height': '22' }) }}
111+
{{ get_image('select_all_arrow', 'With selected:'|trans, {'dir': text_dir, 'width': '38', 'height': '22'}) }}
112112
<input type="checkbox" id="usersForm_checkall" class="checkall_box" title="{% trans 'Check all' %}">
113113
<label for="usersForm_checkall">{% trans 'Check all' %}</label>
114114
<em class="with-selected">{% trans 'With selected:' %}</em>

templates/database/structure/bulk_action_modal.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
</div>
1414
</div>
1515
</div>
16-
</div>
16+
</div>

templates/database/structure/check_all_tables.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="clearfloat d-print-none">
2-
{{ get_image('select_all_arrow', 'With selected:'|trans, { 'dir': text_dir, 'width': '38', 'height': '22' }) }}
2+
{{ get_image('select_all_arrow', 'With selected:'|trans, {'dir': text_dir, 'width': '38', 'height': '22'}) }}
33
<input type="checkbox" id="tablesForm_checkall" class="checkall_box" title="{% trans 'Check all' %}">
44
<label for="tablesForm_checkall">{% trans 'Check all' %}</label>
55
{% if overhead_check != '' %}

0 commit comments

Comments
 (0)