{# Form components #} {% macro input(name, label, type="text", value="", placeholder="", required=false, error=None, help_text=None, autofocus=false, disabled=false) %}
{% if error %}

{{ error }}

{% elif help_text %}

{{ help_text }}

{% endif %}
{% endmacro %} {% macro textarea(name, label, value="", placeholder="", required=false, error=None, help_text=None, rows=4) %}
{% if error %}

{{ error }}

{% elif help_text %}

{{ help_text }}

{% endif %}
{% endmacro %} {% macro select(name, label, options, value="", required=false, error=None, help_text=None, placeholder="Select an option") %}
{% if error %}

{{ error }}

{% elif help_text %}

{{ help_text }}

{% endif %}
{% endmacro %} {% macro checkbox(name, label, checked=false, help_text=None) %}
{% if help_text %}

{{ help_text }}

{% endif %}
{% endmacro %} {% macro radio_group(name, label, options, value="", required=false) %}
{{ label }} {% if required %}*{% endif %}
{% for opt in options %}
{% endfor %}
{% endmacro %} {% macro search_input(name="q", value="", placeholder="Search...", action="") %}
{% endmacro %} {% macro form_actions(submit_label="Save", cancel_url=None) %}
{% if cancel_url %} Cancel {% endif %}
{% endmacro %}