[ticket/17151] Adjust template output formatting

PHPBB3-17151
This commit is contained in:
rxu 2023-09-23 10:21:07 +07:00
parent 130366edfa
commit 830c1f3dc3
No known key found for this signature in database
GPG key ID: 955F0567380E586A
2 changed files with 6 additions and 9 deletions

View file

@ -1,4 +1,4 @@
{% apply replace({"\n": ' ', "\t": ''}) %} {% apply replace({"\n\t": ' ', "\t": '', "\n": ''}) %}
<input <input
{% if CLASS %}class="{{ CLASS }}" {% endif %} {% if CLASS %}class="{{ CLASS }}" {% endif %}
{% if ID %}id="{{ ID }}" {% endif %} {% if ID %}id="{{ ID }}" {% endif %}

View file

@ -1,4 +1,4 @@
{% apply replace({"\n": ' ', "\t": ''}) %} {% apply replace({"\n\t": ' ', "\t": '', "\n": ''}) %}
<select <select
{% if CLASS %}class="{{ CLASS }}" {% endif %} {% if CLASS %}class="{{ CLASS }}" {% endif %}
{% if ID %}id="{{ ID }}" {% endif %} {% if ID %}id="{{ ID }}" {% endif %}
@ -6,20 +6,16 @@
data-{{ attribute|e }}="{{ attribute_value|e('html_attr') }}" data-{{ attribute|e }}="{{ attribute_value|e('html_attr') }}"
{% endfor %} {% endfor %}
name="{{ NAME }}" name="{{ NAME }}"
{% if TOGGLEABLE %}data-togglable-settings="true" {% endif %} {% if TOGGLEABLE %}data-togglable-settings="true"{% endif %}
{% if MULTIPLE %}multiple="multiple"{% endif %}
{% if MULTIPLE %}multiple="multiple" {% endif %} {% if SIZE %}size="{{ SIZE }}"{% endif %}>
{% if SIZE %}size="{{ SIZE }}" {% endif %}>
{% endapply %}
{% for element in OPTIONS %} {% for element in OPTIONS %}
{% if not GROUP_ONLY and element.options %} {% if not GROUP_ONLY and element.options %}
{% apply replace({"\n": ' ', '\t': ''}) %}
<optgroup <optgroup
{% for key, value in element.data %} {% for key, value in element.data %}
data-{{ key }}="{{ value }}" data-{{ key }}="{{ value }}"
{% endfor %} {% endfor %}
label="{{ element.label }}"> label="{{ element.label }}">
{% endapply %}
{% for option in element.options %} {% for option in element.options %}
<option <option
value="{{ option.value }}" value="{{ option.value }}"
@ -36,3 +32,4 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</select> </select>
{% endapply %}