@using MrCMS.Helpers
@using MrCMS.Web.Apps.Ecommerce.Entities.GoogleBase
@model MrCMS.Web.Apps.Ecommerce.Models.GoogleBaseModel

<div class="tab-pane active" id="search">
    <br />
    @using (Html.BeginForm("Dashboard", "GoogleBase", FormMethod.Get, new { id = "Filter" }))
    {
        @Html.DropDownListFor(x => x.Category, ViewData["categories"] as IEnumerable<SelectListItem>, new { @class = "form-control" })
        <br />
        <div class="input-group">@Html.TextBoxFor(x => x.Name, new { @class = "form-control search-query", placeholder = "Enter search term...", style="width:100%!important;" })
            <span class="input-group-btn"><button type="submit" class="btn btn-primary">@Resource("Search")</button>
            </span>
        </div>
    }
    <hr />
    @if (Model.Items.Count == 0)
    {
        <br />
        <p>
            No products found.
        </p>
    }
    else
    {
        <div class="clearfix"></div>
        foreach (var item in Model.Items)
        {
            <div id="google-base-product-variant-@item.Id">
                @Html.Partial("GoogleBaseProduct", item.GoogleBaseProducts.FirstOrDefault() ?? new GoogleBaseProduct { ProductVariant = item })
            </div>
        }
    }

    @Html.Pager(Model.Items, "Dashboard", i => new { page = i })
</div>

@{
    Html.IncludeCss("~/Areas/Admin/Content/Scripts/lib/select2-3.4.5/select2.css");
    Html.IncludeScript("~/Areas/Admin/Content/Scripts/lib/select2-3.4.5/select2.min.js");
}

@{ Html.IncludeScript("~/Apps/Ecommerce/Areas/Admin/Content/Scripts/custom/google-base.js");}
