@inherits ViewModelTemplate<ListEditorViewModel<IEnumerable<string>>>
@using Dynamicweb.Rendering
@using Dynamicweb.Content
@using Dynamicweb.Content.Items
@using Dynamicweb.Content.Items.Rendering
@using System.Linq

@{
string editorId = Model.EditorId;
}

<div class="item-editor-box list-editor-box">
    <ul class="item-lists">
        @if (Model.Items is object)
        {
            for (var i = 0; i < Model.Items.Count; i++)
            {
                <li class="item-clearfix">
                    <input class="item-option-input" type="checkbox" id="@(editorId)_@i" name="@editorId" value="@Model.Items[i].Id" @(Model.SelectedValue?.Any(v => v == Model.Items[i].Id) == true ? "checked" : "") />
                    <label class="item-option-label" for="@(editorId)_@i">@Model.Items[i].Id</label>
                </li>
            }
        }
        else
        {
            for (var i = 0; i < Model.Options.Count; i++)
            {
                <li class="item-clearfix">
                    <input class="item-option-input" type="checkbox" id="@(editorId)_@i" name="@editorId" value="@Model.Options[i].Value" @(Model.Options[i].Selected ? "checked" : "") />
                    <label class="item-option-label" for="@(editorId)_@i">@Model.Options[i].Name dd</label>
                </li>
            }
        }
    </ul>
</div>