wcs/wcs/qommon/templates/qommon/forms/widgets/select.html

17 lines
628 B
HTML

{% extends "qommon/forms/widget.html" %}
{% block widget-control %}
<select id="form_{{widget.name}}" name="{{widget.name}}"
{% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}"{% endfor %}>
{% if not widget.separate_hint and widget.hint %}
<option value="">{{ widget.hint }}</option>
{% endif %}
{% for option in widget.get_options %}
<option{% for attr in option.attrs.items %} {{attr.0}}="{{attr.1}}"{% endfor %}>{{ option.description }}</option>
{% empty %}
{% if widget.separate_hint or not widget.hint %}
<option value="">---</option>
{% endif %}
{% endfor %}
</select>
{% endblock %}