@using System.Linq
@using MrCMS.Helpers
@using MrCMS.Web.Apps.Ecommerce.Pages
@model MrCMS.Web.Apps.Ecommerce.Models.CartModel
@{
    var shippingMethods = ViewData["shipping-methods"] as List<SelectListItem> ?? new List<SelectListItem>();
}
<div class="border-all margin-bottom-20">
    <div class="sub-header grey-background">
        @Resource("Choose a delivery option")
    </div>
    <div class="padding-20">
        <div class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-3 text-right">
                    <label for="ShippingMethod" class="control-label">@Resource("Postage Selection") <span class="red">*</span></label>
                </div>
                <div class="col-sm-6">
                    @if (shippingMethods.Any())
                    {
                        @Html.DropDownList("ShippingMethod", shippingMethods, new { @class = "form-control margin-bottom-10" })
                        <div id="to-payment-details" style="display: @(Model.ShippingMethod != null ? "block" : "hide")">
                            <a class="btn btn-primary btn-block" href="@(UniquePageHelper.GetUrl<PaymentDetails>())">
                                @Resource("Continue to Payment")
                            </a>
                        </div>
                    }
                    else
                    {
                        <p>
                            @Resource("Checkout - No Shipping Available", "There are no available shipping methods for this cart to this address.")
                        </p>
                        <div>
                            <a class="btn btn-default" href="@(UniquePageHelper.GetUrl<Cart>())">
                                @Resource("To Cart")
                            </a>
                        </div>
                    }
                </div>
            </div>
        </div>
    </div>
</div>