Data structure that can be used to build the UI (only use it if it is helpful. Might be easier to just
hardcode all in the template).
Make sure to prefix the name of any
input
created here, so the names don't clash with real fields in
the form.
{% for device, options in choices %}
-
{{ device }}
{% for option_value, verbose_name in options %}
- {{ verbose_name }} (
{{ option_value }}
)
{% endfor %}
{% endfor %}
Save the resulting selection as a space seperated list of css classes into the textarea with
name={{ name }}
. It expects something like:
hidden-xs visible-sm-inline-block visible-lg-block
In the example "None" was selected for
md
, so there is no entry for it. I don't do any server side
validation, so please make sure there are no conflicting entries.
{{ widget_html }}