Skip to content

Commit 3f41dc4

Browse files
committed
Revert equal comparisons in templates.
1 parent 1e638e8 commit 3f41dc4

33 files changed

Lines changed: 52 additions & 52 deletions

templates/about/_about_macro.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
{%- endmacro rowInfoLink %}
5050

5151
{% macro rowInfoBoolean(name, value, enabled) -%}
52-
{%- if value === true or value === false -%}
52+
{%- if value == true or value == false -%}
5353
{%- set enabled = value -%}
5454
{%- set value = value|boolean -%}
5555
{%- endif -%}

templates/admin/product_query.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
{%- set title = 'product.update.title' -%}
4444
{%- set title_icon = ICON_PRODUCT -%}
4545
{%- set title_description = 'product.update.description' -%}
46-
{%- set is_percent = form.type.vars.value === 'percent' -%}
46+
{%- set is_percent = form.type.vars.value == 'percent' -%}
4747
{%- set percent_attr = is_percent ? {} : {disabled: 'disabled'} -%}
4848
{%- set fixed_attr = is_percent ? {disabled: 'disabled'} : {} -%}
4949
{%- set category_id = form.category.vars.value|default(0) -%}

templates/calculation/calculation_pivot.html.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,15 @@
133133

134134
{%- macro output_month(month, selection) %}
135135
{% set attrs = {
136-
class: ['dropdown-item', month === selection ? 'dropdown-item-checked-right'],
136+
class: ['dropdown-item', month == selection ? 'dropdown-item-checked-right'],
137137
href: path('calculation_pivot_index', {months: month}),
138138
} %}
139139
<li><a {{ html_attr(attrs) }}>{{ 'counters.months'|trans({count: month}) }}</a></li>
140140
{% endmacro output_month -%}
141141

142142
{%- macro output_operation(operation, selection) %}
143143
{% set attrs = {
144-
class: ['dropdown-item', operation === selection ? 'dropdown-item-checked-right'],
144+
class: ['dropdown-item', operation == selection ? 'dropdown-item-checked-right'],
145145
href: path('calculation_pivot_index', {operation: operation.value}),
146146
} %}
147147
<li><a {{ html_attr(attrs) }}>{{ operation|trans }}</a></li>
@@ -228,13 +228,13 @@
228228
<thead>
229229
{%- for i in 1..max_col_level -%}
230230
<tr>
231-
{%- if i === 1 -%}
231+
{%- if i == 1 -%}
232232
<td class="text-nowrap not-hover p-0"{{ _self.rowspan(max_col_level) }}{{ _self.colspan(max_row_level) }}>
233233
{{- _self.outputTitle(table, max_col_level) -}}
234234
</td>
235235
{%- endif -%}
236236
{{ _self.outputHeaders(table.rootColumn.nodesAtLevel(i), separator) }}
237-
{%- if i === 1 -%}
237+
{%- if i == 1 -%}
238238
<td{{ _self.rowspan(max_col_level) }} class="text-currency text-bg-success not-hover align-bottom">
239239
{{- total_title -}}
240240
</td>

templates/calculation/calculation_table.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{% if state_id != 0 %}
2020
{% set text = customData.state.code %}
2121
{% elseif state_editable != 0 %}
22-
{% set text = (state_editable === 1 ? 'calculationstate.list.editable_1' : 'calculationstate.list.editable_0')|trans %}
22+
{% set text = (state_editable == 1 ? 'calculationstate.list.editable_1' : 'calculationstate.list.editable_0')|trans %}
2323
{% endif %}
2424
{{ _self.output_dropdown_menu('state', ICON_CALCULATION_STATE, text, 'calculation.list.state_help', input_value, data_default) }}
2525
<ul class="dropdown-menu" aria-labelledby="state">

templates/cards/card_table.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
type: 'button',
3131
role: 'button',
3232
'data-value': value,
33-
class: ['dropdown-item dropdown-' ~ suffix, value === selection ? 'active']})
33+
class: ['dropdown-item dropdown-' ~ suffix, value == selection ? 'active']})
3434
%}
3535
<li>
3636
<button {{ html_attr(attributes) }}>
@@ -107,7 +107,7 @@
107107
{# output a drop-down view item #}
108108
{% macro button_view(icon, view, selection) %}
109109
<li>
110-
<button type="button" class="dropdown-item dropdown-menu-view{% if view === selection %} dropdown-item-checked-right{% endif %}" data-value="{{ view }}">
110+
<button type="button" class="dropdown-item dropdown-menu-view{% if view == selection %} dropdown-item-checked-right{% endif %}" data-value="{{ view }}">
111111
{{- icon(icon ~ ' fa-fw', 'table_view.' ~ view) -}}
112112
</button>
113113
</li>
@@ -278,7 +278,7 @@
278278
</thead>
279279
<tbody{% if row_link|default(true) %} data-link="row" class="rowlink" data-target="a.btn-default"{% endif %}>
280280
{% for row in rows %}
281-
<tr{% if row.id === id %} class="{{ row_selector }}"{%- set row_selector = '' -%}{% endif %}>
281+
<tr{% if row.id == id %} class="{{ row_selector }}"{%- set row_selector = '' -%}{% endif %}>
282282
{% for column in columns %}
283283
<td>{{ row[column.alias]|raw }}</td>
284284
{% endfor %}

templates/chart/chart_month.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{% macro cell_value(value, previous, user_percent = false) -%}
1313
{% if not previous %}
1414
{% set icon = false %}
15-
{% elseif previous === value %}
15+
{% elseif previous == value %}
1616
{% set icon = 'right' %}
1717
{% set color = 'text-secondary' %}
1818
{% elseif previous < value %}
@@ -51,7 +51,7 @@
5151
-}}
5252
<ul class="dropdown-menu dropdown-menu-end">
5353
{% for value in allowedMonths %}
54-
{{ _self.month(value, value === months) }}
54+
{{ _self.month(value, value == months) }}
5555
{% endfor %}
5656
</ul>
5757
{% endif %}

templates/command/commands.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{% for key, names in commands %}
1818
<optgroup label="{{ key }}">
1919
{% for name in names %}
20-
<option{% if name === command.name %} selected{% endif %}>{{ name }}</option>
20+
<option{% if name == command.name %} selected{% endif %}>{{ name }}</option>
2121
{% endfor %}
2222
</optgroup>
2323
{% endfor %}

templates/dialog/dialog_table_sort.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</div>
3636
</div>
3737
{% if column %}
38-
{% set key = column.order === 'asc' ? 'list.sort_ascending_title' : 'list.sort_descending_title' %}
38+
{% set key = column.order == 'asc' ? 'list.sort_ascending_title' : 'list.sort_descending_title' %}
3939
<div class="small text-body-tertiary mt-2">{{ key|trans({'%name%': column.title}) }}</div>
4040
{% endif %}
4141
</div>

templates/dialog/dialog_theme.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<div class="modal-body mx-3">
4343
<span class="form-label mb-3">{{ 'theme.help'|trans }}</span>
4444
{% for theme in themes() %}
45-
{{ _self.output_theme(theme: theme, checked: theme === selection) }}
45+
{{ _self.output_theme(theme: theme, checked: theme == selection) }}
4646
{% endfor %}
4747
</div>
4848
<div class="modal-footer">

templates/footer.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<span class="navbar-text text-truncate text-danger border-end border-secondary d-none" id="footer-message">
55
{{- 'common.data_changed'|trans -}}
66
</span>
7-
<a class="nav-link text-truncate border-end border-secondary{% if app.current_route === 'about_index' %} active{% endif %}" href="{{ path('about_index') }}" title="{{ 'footer.about_title'|trans }}">
7+
<a class="nav-link text-truncate border-end border-secondary{% if app.current_route == 'about_index' %} active{% endif %}" href="{{ path('about_index') }}" title="{{ 'footer.about_title'|trans }}">
88
{{- app_full_name -}}
99
</a>
1010
<span class="navbar-text text-truncate border-end border-secondary" title="{{ 'footer.environment_title'|trans }}">

0 commit comments

Comments
 (0)