mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix some bugs of templates/components/form.html (#1075)
Co-authored-by: Chiya <Ujimatsu Chiya>
This commit is contained in:
1 parent
053978d9d4
commit
2eceb57219
1 file changed
+9
-8
@@ -100,24 +100,25 @@
|
|||||||
name="form_item_{{ args.name }}"
|
name="form_item_{{ args.name }}"
|
||||||
{{ container_attr('radiobox-container', args) }}
|
{{ container_attr('radiobox-container', args) }}
|
||||||
>
|
>
|
||||||
{%- for k, v in options -%}
|
{%- for k, v in args.options -%}
|
||||||
<label class="radiobox">
|
<label class="radiobox">
|
||||||
<input
|
<input
|
||||||
value="{{ k }}"
|
value="{{ k }}"
|
||||||
type="radio"
|
type="radio"
|
||||||
name="{{ v }}"
|
name="{{ args.name }}"
|
||||||
{{ form_attr('radiobox__input', args) }}
|
{{ form_attr('radiobox__input', args) }}
|
||||||
{% if value == args.id %} checked{% endif %}
|
{% if args.value == k %} checked{% endif %}
|
||||||
/> {{ _(v) }}
|
/> {{ _(v) }}
|
||||||
</label>
|
</label>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro form_radio(args) %}
|
{% macro form_radio(args) %}
|
||||||
{{ form_begin({columns:5, label_wrap:false}|assign(args)) }}
|
{{ form_begin({columns:5, label_wrap:false}|assign(args)) }}
|
||||||
{{ radio(args) }}
|
{{ radio(args) }}
|
||||||
{{ form_end({label_warp:false}|assign(args)) }}
|
{{ form_end({label_wrap:false}|assign(args)) }}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro image_radio(args) %}
|
{% macro image_radio(args) %}
|
||||||
@@ -143,9 +144,9 @@
|
|||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro form_image_radio(args) %}
|
{% macro form_image_radio(args) %}
|
||||||
{{ form_begin({columns:8, label_warp:false}|assign(args)) }}
|
{{ form_begin({columns:8, label_wrap:false}|assign(args)) }}
|
||||||
{{ image_radio(args) }}
|
{{ image_radio(args) }}
|
||||||
{{ form_end({label_warp:false}|assign(args)) }}
|
{{ form_end({label_wrap:false}|assign(args)) }}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro text(args) %}
|
{% macro text(args) %}
|
||||||
@@ -154,10 +155,10 @@
|
|||||||
{{ container_attr('textbox-container', args) }}
|
{{ container_attr('textbox-container', args) }}
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
type="{{ 'number' if args.type === 'float' else args.type|default('text') }}"
|
type="{{ 'number' if args.type == 'float' else args.type|default('text') }}"
|
||||||
name="{{ args.name }}"
|
name="{{ args.name }}"
|
||||||
value="{{ args.value }}"
|
value="{{ args.value }}"
|
||||||
{% if args.type === 'float' %} step="any"{% endif %}
|
{% if args.type == 'float' %} step="any"{% endif %}
|
||||||
placeholder="{{ args.placeholder }}"
|
placeholder="{{ args.placeholder }}"
|
||||||
{{ form_attr('textbox', args) }}
|
{{ form_attr('textbox', args) }}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in new issue
Block a user