{# Shared form fields partial. Context: fields, errors, old, resource, prefix, resource_key, record_id (optional) #} {% macro render_field(field, old={}, errors={}, record=none) %} {# to_form_value turns the stored value (or re-flashed old input) into what the control expects #} {% set val = field.to_form_value(old.get(field.attribute, '')) %} {% set has_error = field.attribute in errors %} {% if field.field_type == 'boolean' %}
{{ field._help_text }}
{% endif %} {% if has_error %}{{ errors[field.attribute][0] }}
{% endif %}{{ field._help_text }}
{% endif %} {% if has_error %}{{ errors[field.attribute][0] }}
{% endif %}Current image. Upload a new file to replace it.
{{ field._help_text }}
{% endif %} {% if has_error %}{{ errors[field.attribute][0] }}
{% endif %}{{ field._help_text }}
{% endif %} {% if has_error %}{{ errors[field.attribute][0] }}
{% endif %}{{ field._help_text }}
{% endif %} {% if has_error %}{{ errors[field.attribute][0] }}
{% endif %}{{ field._help_text }}
{% endif %} {% if has_error %}{{ errors[field.attribute][0] }}
{% endif %}{{ field._help_text }}
{% endif %} {% if has_error %}{{ errors[field.attribute][0] }}
{% endif %}{{ field._help_text }}
{% endif %} {% if has_error %}{{ errors[field.attribute][0] }}
{% endif %}{{ field._help_text }}
{% endif %} {% if has_error %}{{ errors[field.attribute][0] }}
{% endif %}{{ field._help_text }}
{% endif %}{{ field._help_text }}
{% endif %} {% if has_error %}{{ errors[field.attribute][0] }}
{% endif %}{{ field._help_text }}
{% endif %}{{ field._help_text }}
{% endif %} {% if has_error %}{{ errors[field.attribute][0] }}
{% endif %}