{% spaceless %}{% load rijkshuisstijl rijkshuisstijl_utils %} {% capture as base_attrs %} {% if name %} name="{{ name }}"{% endif %}{% if value %} value="{{ value }}"{% endif %}{% endcapture %} {% capture as optional_attrs %}{% if choice.value == value or choice.value in value or checked %} checked{% endif %}{% if choice %} value="{{ choice.value }}"{% endif %}{% endcapture %} {% capture as valdation_attrs %}{% if disabled %} disabled{% endif %}{% if readonly%} readonly{% endif %}{% if required %} required{% endif %}{% endcapture %} {% capture as html_id %}{% if id and choice %}{{ id|add:'_'|add:choice.value|slugify }}{% elif id %}{{ id }}{% elif choice %}{% endif %}{% endcapture %} {% capture as meta_attrs %}{% if html_id %} id="{{ html_id }}"{% endif %}{% endcapture %} {% capture as data_attrs %}{% if select_all %} data-select-all="{{ select_all }}"{% endif %}{% endcapture %} {% capture as additional_attrs %}{% for attr, value in widget_attrs.items %} {{ attr }}="{{ value }}"{% endfor %}{% endcapture %}