@using MrCMS.Web.Apps.Ecommerce.Helpers
@model MrCMS.Web.Apps.Ecommerce.Entities.GoogleBase.GoogleBaseProduct
@{
    var gender = ViewData["genders"] as IEnumerable<SelectListItem>;
    var ageGroup = ViewData["age-groups"] as IEnumerable<SelectListItem>;
    var productConditions = ViewData["product-conditions"] as IEnumerable<SelectListItem>;
}

@using (Html.BeginForm("UpdateGoogleBaseProduct", "GoogleBase", FormMethod.Post))
{
    <div class="row">
        <div class="col-lg-6">
            @Html.HiddenFor(x => x.ProductVariant.Id)
            @Html.HiddenFor(x => x.Id)
            <h4>&nbsp;@(!string.IsNullOrWhiteSpace(Model.ProductVariant.Name) ? Model.ProductVariant.Name : Model.ProductVariant.Product.Name)</h4>
            <br />
            <div style="width:100%; overflow: hidden">
                @Html.LabelFor(x => x.Category)
                @Html.HiddenFor(x => x.Category,new {@class="select2 select2-full", style="width:100%", @data_category_name=Model.Category})
            </div>
            <br />
            <button type="button" class="btn btn-default update-google-base-product" data-google-base-product-id="@Model.Id" data-google-base-product-variant-id="@Model.ProductVariant.Id">
                Update
            </button>
        </div>
        <div class="col-lg-3">
            <div class="form-group">
                @Html.LabelFor(x => x.Condition)
                @Html.DropDownListFor(x => x.Condition, GeneralHelper.SelectDefaultValue(productConditions, Model.Condition.ToString()), new { @class = "form-control" })
            </div>
            <div class="form-group">
                @Html.LabelFor(x => x.Gender)
                @Html.DropDownListFor(x => x.Gender, GeneralHelper.SelectDefaultValue(gender, Model.Gender.ToString()), new { @class = "form-control" })
            </div>
            <div class="form-group">
                @Html.LabelFor(x => x.AgeGroup)
                @Html.DropDownListFor(x => x.AgeGroup, GeneralHelper.SelectDefaultValue(ageGroup, Model.AgeGroup.ToString()), new { @class = "form-control" })
            </div>
        </div>
        <div class="col-lg-3">
            <div class="form-group">
                @Html.LabelFor(x => x.Grouping)
                @Html.TextBoxFor(x => x.Grouping, new { @class = "form-control", placeholder = "e.g: comforters" })
            </div>
            <div class="form-group">
                @Html.LabelFor(x => x.Labels)
                @Html.TextBoxFor(x => x.Labels, new { @class = "form-control", placeholder = "e.g: clothing, shoes" })
            </div>
            <div class="form-group">
                @Html.LabelFor(x => x.Redirect)
                @Html.TextBoxFor(x => x.Redirect, new { @class = "form-control", placeholder = "e.g: http://www.merchant.com/product.html" })
            </div>
        </div>
    </div>
}
<hr />
