{% macro message(type, content, raw=false, discreet=false) %}
{{ content|safe if raw else content }}
{% endmacro %} {% macro messages(flash) %} {% set flashed = flash() %} {% set display = 0 %} {% for type, bag in flashed %} {% if bag|length %} {% set display = 1 %} {% endif %} {% endfor %} {% if display %}
{% for type, bag in flashed %} {% for content in bag %} {{ message(type, content) }} {% endfor %} {% endfor %}
{% endif %} {% endmacro %} {% macro csrf(getCsrfToken) %} {% endmacro %} {% macro field(_locals, type, name, value, placeholder, hint, validation_attributes='', extraData='', icon=null) %} {% set validation = _locals.validation() %} {% set validation = validation[name] if validation[name] or null %} {% set previousFormData = _locals.previousFormData() %} {% set value = previousFormData[name] or value or validation.value or '' %} {% set prefix = _locals.getFormPrefix() | default('') %} {% if type == 'hidden' %} {% if validation %} {{ message('error', validation.message) }} {% endif %} {% else %}
{% if icon != null %} {% if icon.startsWith('fa') %} {% else %} {% endif %} {% endif %} {% if type == 'duration' %}
{% for f in extraData %}
{% if previousFormData[name] %} {% set v = value[f] %} {% else %} {% set v = (value % 60) if f == 's' else (((value - value % 60) / 60 % 60) if f == 'm' else ((value - value % 3600) / 3600 if f == 'h')) %} {% endif %}
{% endfor %}
{% elseif type == 'select' %} {% elseif type == 'textarea' %} {% else %} {% endif %}
{{ fieldError(_locals, name) }} {% if hint %}
{{ hint }}
{% endif %}
{% endif %} {% endmacro %} {% macro fieldError(_locals, name) %} {% set validation = _locals.validation() %} {% set validation = validation[name] if validation[name] or null %} {% if validation %}
{{ validation.message }}
{% endif %} {% endmacro %} {% macro websocket(websocketUrl, listener, reconnectOnClose = 1, checkFunction = 0) %} {% endmacro %} {% macro paginate(pagination, routeName, contextSize) %} {% if pagination.hasPrevious() or pagination.hasNext() %} {% endif %} {% endmacro %} {% macro breadcrumb(currentPageTitle, pages=[]) %} {% endmacro %}