[ticket/17100] Improve output of unwrapped macros

PHPBB3-17100
This commit is contained in:
Marc Alexander 2022-04-18 20:50:23 +02:00
parent 2dfe5ebe6d
commit 003b606781
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -1,4 +1,5 @@
{% macro input(form_data) %}
{% apply replace({"\n": ' ', '\t': ''}) %}
<input
{% if form_data.id %}id="{{ form_data.id }}"{% endif %}
type="{{ form_data.type }}"
@ -10,8 +11,8 @@
{% if form_data.type == 'password' %}autocomplete="off"{% endif %}
{% if form_data.checked %}checked="checked"{% endif %}
{% if form_data.class %}class="{{ form_data.class }}"{% endif %}
value="{{ form_data.value }}"
>
value="{{ form_data.value }}">
{% endapply %}
{% endmacro %}
{% macro dimension(form_data) %}
@ -19,14 +20,15 @@
{% endmacro %}
{% macro textarea(form_data) %}
{% apply replace({"\n": ' ', '\t': ''}) %}
<textarea
id="{{ form_data.id }}"
name="{{ form_data.name }}"
rows="{{ form_data.rows }}"
cols="{{ form_data.cols }}"
>
cols="{{ form_data.cols }}">
{{ form_data.content }}
</textarea>
{% endapply %}
{% endmacro %}
{% macro radio_buttons(form_data) %}
@ -35,7 +37,7 @@
{% endmacro %}
{% macro select(form_data) %}
<select id="{{ form_data.id }}" name="{{ form_data.name }}">
<select {% if form_data.id %}id="{{ form_data.id }}"{% endif %} name="{{ form_data.name }}">
{% for option in form_data.options %}
<option value="{{ option.value }}"{% if option.selected %} selected="selected"{% endif %}>{{ option.label }}</option>
{% endfor %}