{% load i18n %}{% load blockjsondata jsonify from creme_core_tags %}
{% blockjsondata class="ordered-widget-choices" %} [ {% for group_name, group_choices, group_index in widget.optgroups %}{# TODO: manage group ? #} {% for option in group_choices %}{"value": "{{option.value.value}}", "label": "{{option.label|escapejs}}", "help": "{{option.value.help|escapejs}}"{% if option.value.disabled %}, "disabled": true{% endif %} }{% if not forloop.last %},{% endif %}{% endfor %} {% if not forloop.last %},{% endif %} {% endfor %} ] {% endblockjsondata %}
{{widget.available_title}}
{{widget.enabled_title}}
{% comment %} {% load creme_core_tags %} {% with name=widget.name orders=widget.orders %} {% for group_name, group_choices, group_index in widget.optgroups %}{# TODO: manage group ? #} {% for option in group_choices %} {% with order=orders|get_value:option.value %} {% endwith %} {% endfor %}{% endfor %}
{{option.label}}
{% endwith %} {% endcomment %}