@model MrCMS.Web.Apps.Ecommerce.Pages.Product
<div id="related-products">
    
    <div class="row">
        <div class="col-lg-6">
            <h4>Related Products</h4>
        </div>
        <div class="col-lg-6">
            <div class="btn-group pull-right">
                @Html.ActionLink("Add", "AddRelatedProduct", "Product", new { id = Model.Id }, new { @class = "btn-xs btn-default btn" , data_toggle = "fb-modal" })
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            @if (Model.RelatedProducts.Any())
            {
                <table class="table table-striped table-condensed">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model.PublishedRelatedProducts)
                        {
                            <tr>
                                <td>@item.Name</td>
                                <td>@Html.ActionLink("Remove", "RemoveRelatedProduct", "Product",
                                                     new {id = Model.Id, relatedProductId = item.Id}, new
                                                         {
                                                             @class = "btn btn-danger btn-xs pull-right",
                                                             data_toggle = "fb-modal"
                                                         })</td>
                            </tr>
                        }
                    </tbody>
                </table>
            }
            else
            {
                <span>No related products have been specified.</span>
            }
        </div>
    </div>
</div>