{% import 'macros/form.html' as form %} {% include 'scheming/snippets/suggestions_asset.html' %} {# Check if this is a preformulated field (i.e., has a 'formula') #} {% set is_preformulated = h.is_preformulated_field(field) %} {# Create a custom label with suggestion button(s) and icons #} {% set suggestion = h.scheming_field_suggestion(field) %} {% set label_text = h.scheming_language_text(field.label) %} {% set label_with_extras %} {{ label_text }}: {%- if suggestion -%} {%- snippet 'scheming/snippets/suggestion_button.html', field=field, data=data -%} {%- endif -%} {%- if is_preformulated -%} {%- endif -%} {% endset %} {% call form.input( field.field_name, id='field-' + field.field_name, label=label_with_extras|safe, placeholder=h.scheming_language_text(field.form_placeholder), value=data[field.field_name], error=errors[field.field_name], classes=field.classes if 'classes' in field else ['control-medium'], attrs=dict({"class": "form-control"}, **(field.get('form_attrs', {}))), is_required=h.scheming_field_required(field) ) %}
{%- if is_preformulated -%}
Automated field: This field is automatically populated.
{%- endif -%} {%- snippet 'scheming/form_snippets/help_text.html', field=field -%}
{% endcall %}