{% load erp_tags %} {% comment %} The deployment's field definitions as fieldsets, one per definition group (docs/crm/phase4-fields.md 3.3, 5.2, 5.7). Context: ``form`` (a form with core.sidecar_forms.DefinitionFieldsMixin). ``wrap_cards``: each group in its own card (the generic form page) instead of a bare fieldset. {% endcomment %} {% for section in form.definition_sections %} {% if wrap_cards %}
{% endif %}
{{ section.title }}
{% for field_name in section.fields %} {% with field=form|get_form_field:field_name %} {% if field %}
{% if field.field.widget.allow_multiple_selected and field.field.widget.input_type == "checkbox" %} {{ field.label }}{% if field.field.required %} (required){% endif %} {% for option in field %}
{{ option.tag }}
{% endfor %}
{% else %} {{ field|add_class:"form-control form-control-sm" }} {% endif %} {% if field.errors %}
{{ field.errors.0 }}
{% endif %} {% if field.help_text %}{{ field.help_text }}{% endif %}
{% endif %} {% endwith %} {% endfor %} {% if wrap_cards %}{% endif %} {% endfor %} {% if form.hidden_definitions %}

{{ form.hidden_definitions|length }} personal-data field{{ form.hidden_definitions|length|pluralize }} {{ form.hidden_definitions|length|pluralize:"is,are" }} hidden: viewing personal data needs the “Can export personal data columns from CRM lists” permission.

{% endif %}