File: radioselect.html

package info (click to toggle)
python-django-crispy-forms 1.14.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,676 kB
  • sloc: python: 4,025; makefile: 92; sh: 16
file content (14 lines) | stat: -rw-r--r-- 832 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{% load crispy_forms_filters %}
{% load l10n %}

<div class="controls"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}>
    {% include 'bootstrap/layout/field_errors_block.html' %}

    {% for choice in field.field.choices %}
        <label for="id_{{ field.html_name }}_{{ forloop.counter0 }}" class="radio{% if inline_class %} {{ inline_class }}{% endif %}">
            <input type="radio"{% if choice.0|stringformat:"s" == field.value|default_if_none:""|stringformat:"s" %} checked{% endif %} name="{{ field.html_name }}" id="id_{{ field.html_name }}_{{ forloop.counter0 }}" value="{{ choice.0|unlocalize }}" {% if field.field.disabled %}disabled="true"{% endif %} {{ field.field.widget.attrs|flatatt }}>{{ choice.1|unlocalize }}
        </label>
    {% endfor %}

    {% include 'bootstrap/layout/help_text.html' %}
</div>