@model PollModel

<div class="card-body">
    <div class="form-group row" @(Model.AvailableLanguages.SelectionIsNotPossible() ? Html.Raw("style=\"display:none\"") : null)>
        <div class="col-md-3">
            <nop-label asp-for="LanguageId" />
        </div>
        <div class="col-md-9">
            <nop-select asp-for="LanguageId" asp-items="Model.AvailableLanguages" />
            <span asp-validation-for="LanguageId"></span>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-md-3">
            <nop-label asp-for="Name" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="Name" asp-required="true" />
            <span asp-validation-for="Name"></span>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-md-3">
            <nop-label asp-for="Published" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="Published" />
            <span asp-validation-for="Published"></span>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-md-3">
            <nop-label asp-for="ShowOnHomepage" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="ShowOnHomepage" />
            <span asp-validation-for="ShowOnHomepage"></span>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-md-3">
            <nop-label asp-for="AllowGuestsToVote" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="AllowGuestsToVote" />
            <span asp-validation-for="AllowGuestsToVote"></span>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-md-3">
            <nop-label asp-for="StartDateUtc" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="StartDateUtc" />
            <span asp-validation-for="StartDateUtc"></span>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-md-3">
            <nop-label asp-for="EndDateUtc" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="EndDateUtc" />
            <span asp-validation-for="EndDateUtc"></span>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-md-3">
            <nop-label asp-for="SelectedStoreIds" />
        </div>
        <div class="col-md-9">
            <nop-select asp-for="SelectedStoreIds" asp-items="Model.AvailableStores" asp-multiple="true" />
            <script>
                $(function() {
                    var storesIdsInput = $('#@Html.IdFor(model => model.SelectedStoreIds)').select2({
                        closeOnSelect: false,
                        @if (!Model.AvailableStores.Any())
                        {
                        <text>
                        disabled: true,
                        placeholder: 'No stores available',
                        </text>
                        }
                    });
                });
            </script>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-md-3">
            <nop-label asp-for="SystemKeyword" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="SystemKeyword" />
            <span asp-validation-for="SystemKeyword"></span>
        </div>
    </div>
    <div class="form-group row">
        <div class="col-md-3">
            <nop-label asp-for="DisplayOrder" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="DisplayOrder" />
            <span asp-validation-for="DisplayOrder"></span>
        </div>
    </div>
</div>