{%- set allLabel = (allLabel is defined ? allLabel : "All"|t) %}
{%- set allValue = (allValue is defined ? allValue : '*') %}
{%- set options = (options is defined ? options : []) %}
{%- set values = (values is defined ? values : []) -%}
{% include "_includes/forms/checkbox" with {
id: (id is defined ? id : null),
class: 'all',
label: '' ~ (allLabel is defined ? allLabel : "All"|t) ~ '',
name: (name is defined ? name : null),
value: allValue,
checked: (values is empty or values == allValue),
autofocus: (autofocus is defined and autofocus and not craft.request.isMobileBrowser(true))
} only %}
{%- for key, option in options %}
{%- set optionLabel = (option.label is defined ? option.label : option) %}
{%- set optionValue = (option.value is defined ? option.value : key) -%}
{% include "_includes/forms/checkbox" with {
label: optionLabel,
name: (name is defined ? name~'[]' : null),
value: optionValue,
checked: (values is empty or optionValue in values),
disabled: (values is empty)
} only %}