{# Reusable form macros #} {# Text input field #} {% macro text_input(name, label, type='text', placeholder='', value='', required=false, error=none, help=none) %}
{% if help %}

{{ help }}

{% endif %} {% if error %} {% endif %}
{% endmacro %} {# Textarea field #} {% macro textarea(name, label, placeholder='', value='', required=false, rows=4, error=none, help=none) %}
{% if help %}

{{ help }}

{% endif %} {% if error %} {% endif %}
{% endmacro %} {# Select dropdown #} {% macro select(name, label, options, selected='', required=false, error=none, help=none) %}
{% if help %}

{{ help }}

{% endif %} {% if error %} {% endif %}
{% endmacro %} {# Checkbox #} {% macro checkbox(name, label, checked=false, help=none) %}
{% if help %}

{{ help }}

{% endif %}
{% endmacro %} {# Primary button #} {% macro button_primary(text, type='submit', name=none, disabled=false, full_width=false) %} {% endmacro %} {# Secondary button #} {% macro button_secondary(text, type='button', name=none, disabled=false, full_width=false) %} {% endmacro %} {# Danger button #} {% macro button_danger(text, type='button', name=none, disabled=false) %} {% endmacro %} {# Ghost/link button #} {% macro button_ghost(text, href='#') %} {{ text }} {% endmacro %} {# Form error alert #} {% macro form_errors(errors) %} {% if errors %} {% endif %} {% endmacro %} {# Success alert #} {% macro success_alert(message) %} {% if message %} {% endif %} {% endmacro %}