{% macro input_csrf_token(token=none) -%} {% if token is sameas none %} {% set token = csrf_token() %} {% else %} {% set token = token |e %} {% endif %} {%- endmacro %} {% macro input_text(label, input_name, value=None, required=False, multivalue=False, multivalue_parent_css_id=None, enable_input=true, comment=none, comment_as_tooltip=false, comment_as_text=false, size=35, maxlength=0) -%} {% if not value %} {% set value = '' %} {% endif %}

{{ label }}{% if required %}*{% endif %}

{% if enable_input %}{% if multivalue %}{% endif %}{% endif %} {% if comment %} {% if comment_as_tooltip %} {% elif comment_as_text %} {{ comment |e }} {% else %} {{ comment |e }} {% endif %} {% endif %}
{%- endmacro %} {% macro input_radios(label, input_name, options, value=None, required=False, comment=none, comment_as_tooltip=false, enable_input=true) -%} {# `options` must be a list with 2-element tuples: [('', '', ''), ...] #} {% if not value %} {% set value = '' %} {% endif %} {% for (_opt_value, _opt_desc) in options %}

{%- if loop.first -%} {{ label }} {%- if required -%}*{%- endif -%} {%- if comment -%} {%- if comment_as_tooltip -%}   {%- else -%} {{ comment |e }} {%- endif -%} {%- endif -%} {% else %}   {%- endif -%}

{% if _opt_desc %} {{ _opt_desc |e }}{% endif %}
{% endfor %} {% endmacro %} {% macro input_checkbox(label, input_name, checked=false, required=false, enable_input=true, comment=none, comment_as_tooltip=false, add_hidden_input=false) -%}

{% if label %}{{ label }}{% else %} {% endif %}{% if required %}*{% endif %}

{% if comment %} {% if comment_as_tooltip %} {% else %} {{ comment |e }} {% endif %} {% endif %} {% if add_hidden_input %} {% endif %}
{% endmacro %} {% macro input_textarea(label, input_name, value=None, comment=None, is_list_of_emails=False, is_list_of_ip_or_network=False, required=False, enable_input=true, rows=4, cols='50%') -%} {% if not value %} {% set value = '' %} {% endif %}

{{ label }}{% if required %}*{% endif %}

{% if is_list_of_emails %} {{ _('One mail address per line. Invalid address will be discarded.') }} {% elif is_list_of_ip_or_network %} {{ _('One IP address or network per line. Invalid address or network will be discarded.') }} {% endif %}
{%- endmacro %} {% macro input_select(label, input_name, options, value=none, offer_none=false) -%}

{% if label %}{{ label |e }}{% else %} {% endif %}

{% endmacro %} {% macro input_submit(label=none, name=none, color='green', float=none) -%}

 

{%- endmacro %}