<script type="text/x-handlebars-template">

    {{#if options.multiple}}

        {{#each selectOptions}}

            <div>

                <label>

                    <input type="checkbox" data-checkbox-index="{{@index}}" data-checkbox-value="{{value}}" {{#if selected}}checked{{/if}} {{#if ../options.readonly}}readonly="readonly"{{/if}} {{#if name}}name="{{name}}"{{/if}} {{#each ../options.data}}data-{{@key}}="{{value}}"{{/each}}/>
                    {{{text}}}

                </label>
            </div>

        {{/each}}

    {{else}}

        <div>

            <label>

                <input type="checkbox" {{#if data.length}}checked{{/if}} {{#if options.readonly}}readonly="readonly"{{/if}} {{#if name}}name="{{name}}"{{/if}} {{#each options.data}}data-{{@key}}="{{value}}"{{/each}}/>

                {{#if options.rightLabel}}
                    {{{options.rightLabel}}}
                {{/if}}

            </label>

        </div>

    {{/if}}

</script>
