@using MrCMS.Helpers
@model MrCMS.Web.Apps.Amazon.Models.AmazonListingModel

<div data-paging-type="async" id="product-variants-search">
    @if (!Model.ProductVariants.Any())
    {
        <br/>
        <p>
            No product variants found.
        </p>
    }
    else
    {
        <table class="table table-condensed table-striped">
            <thead>
                <tr>
                    <th>
                        SKU
                    </th>
                    <th>
                        Name
                    </th>
                    <th>
                        
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.ProductVariants)
                {
                    <tr>
                        <td>
                            @item.SKU
                        </td>
                        <td>
                            @Html.ActionLink(item.DisplayName, "Edit", "Webpage", new {id = item.Product.Id}, null)
                        </td>
                        <td>
                            @Html.ActionLink("Choose", "AddOne", "Listing", new {productVariantSku = item.SKU, amazonListingGroupId = Model.AmazonListingGroup.Id}, new {@class = "btn btn-xs btn-success"})
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    }
        
    @Html.Pager(Model.ProductVariants, "ProductVariants", i => new {page = i})
</div>

@{ Html.IncludeScript("~/Apps/Amazon/Areas/Admin/Content/Scripts/custom/async-paging.js"); }