{# Added "wrap_label", which is lost in 1.11 by using the radio select as sub widget #}
{% with id=widget.attrs.id %}<ul{{ widget.flatatt }}>{% for group, options, index in widget.optgroups %}{% if group %}
  <li>{{ group }}<ul{% if id %} id="{{ id }}_{{ index }}"{% endif %}>{% endif %}{% for option in options %}
    <li>{% include option.template_name with widget=option wrap_label=True %}</li>{% endfor %}{% if group %}
  </ul></li>{% endif %}{% endfor %}
</ul>{% endwith %}
