@using System.Linq
@using MrCMS.Helpers
@using MrCMS.Web.Areas.Admin.Helpers
@model MrCMS.Web.Apps.Ecommerce.Models.EmailAndLoginModel
@{
    var errorMessages = TempData.ErrorMessages();
}
@using (Html.BeginForm("SetOrderEmailAndLogin", "EnterOrderEmail", FormMethod.Post))
{
    if (errorMessages.Any())
    {
        <div class="alert alert-danger" role="alert">
            <ul>
                @foreach (var message in errorMessages)
                {
                    <li>@message</li>
                }
            </ul>
        </div>
    }

    <div class="border-all">
        <div class="sub-header grey-background">
            <h1>@Resource("Checkout Enter Order Email - Title", "Email Address")</h1>
        </div>
        <div class="padding-20">
            <div class="row">
                <div class="col-sm-8">
                    <div class="form-group">
                        @Html.LabelFor(x => x.OrderEmail, Resource("Enter your Email address")) <span class="red">*</span>
                        @Html.TextBoxFor(x => x.OrderEmail, new { placeholder = "Email address", @class = "form-control" })
                        @Html.ValidationMessageFor(x => x.OrderEmail)
                    </div>

                    <label>@Resource("Checkout Enter Order Email - Have Password", "Do you have a password?")</label>
                    <div class="margin-bottom-10">
                        <div class="radio">
                            <label>
                                @Html.RadioButtonFor(model => model.HavePassword, false) @Resource("Checkout Enter Order Email - Have Password False", "No (Checkout as guest - you can create an account later)")
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                @Html.RadioButtonFor(model => model.HavePassword, true) @Resource("Checkout Enter Order Email - Have Password True", "Yes")
                            </label>
                        </div>
                    </div>
                    <div id="password-box" style="display: none" class="margin-bottom-10">
                        @Html.PasswordFor(model => model.Password, new { placeholder = "Enter your password here", @class = "form-control" })
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-4">
                    <input class="btn btn-primary btn-block" type="submit" id="continue" name="continue" value="@Resource("Continue Securely")" />
                </div>
            </div>
        </div>
    </div>
}
@{ Html.IncludeScript("~/Apps/Ecommerce/Content/Scripts/custom/enter-order-email.js"); }