@param name: name of the field
@param options_list(list[str, str]): list of name, label of options
@param selected(none, list): list of select elements
@param required(bool): true this field is required
@param multiple(bool): true is multiple selection is possible
#}
{% for value, label in options_list %}
{{label}}
{% endfor %}
{% endmacro %}
{% macro choices(name, choices_list, checked=none) %}
{% for choice, label in choices_list %}
{{label}}
{% endfor %}
{% endmacro %}
{% macro int(name, label="", init=0) %}
{{ field("number", name=name, label=label, value=init, step=1, min=0, **kwargs) }}
{% endmacro %}
{% macro checkbox(name, label="", checked=false) %}
{% if checked %}
{{ field("checkbox", name=name, label=label, checked="checked", **kwargs) }}
{% else %}
{{ field("checkbox", name=name, label=label, **kwargs) }}
{% endif %}
{% endmacro %}
{% macro text(name, label="", placeholder="", required=false) %}
{{ field("text", name=name, label=label, required=required, placeholder=placeholder, **kwargs) }}
{% endmacro %}
{% macro password(name, label="", required=false) %}
{{ field("password", name=name, label=label, required=required, **kwargs) }}
{% endmacro %}
{% macro email(name, label="", required=false) %}
{{ field("email", name=name, label=label, required=required, **kwargs) }}
{% endmacro %}
{% macro date(name, label="", required=false) %}
{{ field("date", name=name, label=label, required=required, **kwargs) }}
{% endmacro %}
{% macro url(name, label="", required=false) %}
{{ field("url", name=name, label=label, required=required, **kwargs) }}
{% endmacro %}
{% macro file(name, label="", required=false) %}
{{ field("file", name=name, label=label, required=required, **kwargs) }}
{% endmacro %}
{% macro textarea(name, label="", rows=10, cols=50, placeholder='', required=false) %}
{% set cur_id = name|next_gidx %}
{% if label %}
{{label}}
{% endif %}
{% endmacro %}
{% macro meta(name, value) %}
{% endmacro %}
{% macro submit(text=_("Send"), id=none) %}
{# submit button
@param text(str): label of the button
@param id(none, str): id of the element
#}
{% endmacro %}