{% with id=widget.attrs.id %}{% for group, options, index in widget.optgroups %}{% if group %}

{{ group }}

{% endif %}{% for option in options %} {% include "looseleaf/widgets/input_option.html" with widget=option %}{% endfor %}{% endfor %} {% endwith %}