{% set all = data.assignments == 'all' %}
{% for type, types in assignments %}
{% for name, list in types %}
{{ list.label }}
{% set path = 'assignments.' ~ type ~ '.' ~ name %}
{% set all_value = all or nested(data, path) is same as(true) %}
{% include 'forms/fields/enable/enable.html.twig' with {
'default': true,
'name': path|fieldName,
'field': link.field,
'value': all_value,
'disabled': not all_value
} %}
{% for link in list.items %}
{% set path = 'assignments.' ~ type ~ '.' ~ name ~ '.' ~ link.name %}
{% set group = link.section ? 'data-g-assignments-group="' ~ link.name|e ~ '"' : 'data-g-assignments-parent="' ~ link.taxonomy|e ~ '"' %}
{% set value = 0 or nested(data, path) %}
{% endfor %}