@using System.Linq
@using MrCMS.Web.Apps.Ecommerce.Settings
@model System.Collections.Generic.List<MrCMS.Web.Apps.Ecommerce.Areas.Admin.Models.ShippingMethodInfo>
@{
    ViewBag.Title = "Shipping Methods";
}
@using (Html.BeginForm("Index", "ShippingMethod"))
{
    <fieldset>
        <legend>
            Shipping Methods
            <span class="btn-group  display-inline  pull-right">
                <button type="submit" class="btn btn-primary">Update enabled methods</button>
            </span>
        </legend>
        @if (Model.Any())
        {
            <table class="table table-condensed table-striped">
                <thead>
                    <tr>
                        <th>
                            Name
                        </th>
                        <th>
                            Display Name
                        </th>
                        <th>
                            Description
                        </th>
                        <th>
                            Enabled?
                        </th>
                        <th>
                            Actions
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>
                                @item.Name
                            </td>
                            <td>
                                @item.DisplayName
                            </td>
                            <td>
                                @item.Description
                            </td>
                            <td>
                                @Html.CheckBox("method-" + item.Type, item.Enabled)
                            </td>
                            <td>
                                @if (item.Configurable)
                                {
                                    <a href="@item.ConfigureUrl">Configure</a>
                                }
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        }
        else
        {
            <p>
                No shipping methods.
            </p>
        }
    </fieldset>
}