@model Nop.Web.Models.Customer.RegisterModel
@using Nop.Web.Framework;
@using Nop.Web.Framework.UI.Captcha;
@{
    Layout = "~/Views/Shared/_ColumnsThree.cshtml";

    //title
    Html.AddTitleParts(T("PageTitle.Register").Text);
}
@using (Html.BeginForm(Url.RouteUrl("Register")))
{
    <div class="registration-page">
        <div class="page-title">
            <h1>@T("Account.Register")</h1>
        </div>
        <div class="clear">
        </div>
        <div class="body">
            <div class="message-error">
                <div>
                    @*@Html.ValidationSummary(true, T("Account.Register.Unsuccessful").Text)*@
                    @Html.ValidationSummary(true)
                </div>
            </div>
            <div class="clear">
            </div>
            <div class="section-title">
                @T("Account.YourPersonalDetails")
            </div>
            <div class="clear">
            </div>
            <div class="section-body">
                <table class="table-container">
                    <tbody>
                        @if (Model.GenderEnabled)
                        {
                            <tr class="row">
                                <td class="item-name">
                                    @Html.LabelFor(model => model.Gender):
                                </td>
                                <td class="item-value">
                                    @Html.RadioButton("Gender", "M", (Model.Gender == "M"), new { id = "Gender_Male" })
                                    <label class="forcheckbox" for="Gender_Male">@T("Account.Fields.Gender.Male")</label>
                                    @Html.RadioButton("Gender", "F", (Model.Gender == "F"), new { id = "Gender_Female" })
                                    <label class="forcheckbox" for="Gender_Female">@T("Account.Fields.Gender.Female")</label>
                                </td>
                            </tr>
                        }
                        <tr class="row">
                            <td class="item-name">
                                @Html.LabelFor(model => model.FirstName):
                            </td>
                            <td class="item-value">
                                @Html.EditorFor(model => model.FirstName)
                                @Html.ValidationMessageFor(model => model.FirstName)
                            </td>
                        </tr>
                        <tr class="row">
                            <td class="item-name">
                                @Html.LabelFor(model => model.LastName):
                            </td>
                            <td class="item-value">
                                @Html.EditorFor(model => model.LastName)
                                @Html.ValidationMessageFor(model => model.LastName)
                            </td>
                        </tr>
                        @if (Model.DateOfBirthEnabled)
                        {
                            <tr class="row">
                                <td class="item-name">
                                    @Html.LabelFor(model => model.DateOfBirthDay):
                                </td>
                                <td class="item-value">
                                    @Html.DatePickerDropDowns(Html.FieldNameFor(x => x.DateOfBirthDay),
                                Html.FieldNameFor(x => x.DateOfBirthMonth),
                                Html.FieldNameFor(x => x.DateOfBirthYear),
                                DateTime.Now.Year - 110,
                                DateTime.Now.Year,
                                Model.DateOfBirthDay,
                                Model.DateOfBirthMonth,
                                Model.DateOfBirthYear)
                                    @Html.ValidationMessageFor(model => model.DateOfBirthDay)
                                    @Html.ValidationMessageFor(model => model.DateOfBirthMonth)
                                    @Html.ValidationMessageFor(model => model.DateOfBirthYear)
                                </td>
                            </tr>
                        }
                        <tr class="row">
                            <td class="item-name">
                                @Html.LabelFor(model => model.Email):
                            </td>
                            <td class="item-value">
                                @Html.EditorFor(model => model.Email)
                                @Html.ValidationMessageFor(model => model.Email)
                            </td>
                        </tr>
                        @if (Model.UsernamesEnabled)
                        {
                            <tr class="row">
                                <td class="item-name">
                                    @Html.LabelFor(model => model.Username):
                                </td>
                                <td class="item-value">
                                    @Html.EditorFor(model => model.Username)
                                    @Html.ValidationMessageFor(model => model.Username)
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
            <div class="clear">
            </div>
            @if (Model.CompanyEnabled || Model.DisplayVatNumber)
            {
                <div class="section-title">
                    @T("Account.CompanyDetails")
                </div>
                <div class="clear">
                </div>
                <div class="section-body">
                    <table class="table-container">
                        <tbody>
                            @if (Model.CompanyEnabled)
                            {
                                <tr class="row">
                                    <td class="item-name">
                                        @Html.LabelFor(model => model.Company):
                                    </td>
                                    <td class="item-value">
                                        @Html.EditorFor(model => model.Company)
                                        @Html.ValidationMessageFor(model => model.Company)
                                    </td>
                                </tr>
                            }
                            @if (Model.DisplayVatNumber)
                            {
                                <tr class="row">
                                    <td class="item-name">
                                        @Html.LabelFor(model => model.VatNumber):
                                    </td>
                                    <td class="item-value">
                                        @Html.EditorFor(model => model.VatNumber)
                                        @Html.ValidationMessageFor(model => model.VatNumber)
                                    </td>
                                </tr>
                                <tr class="row">
                                    <td colspan="2">
                                        <i>@T("Account.Fields.VatNumber.Note")</i>
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>                       
                <div class="clear">
                </div>
            }
            @if (Model.NewsletterEnabled)
            {
                <div class="section-title">
                    @T("Account.Options")
                </div>
                <div class="clear">
                </div>
                <div class="section-body">
                    <table class="table-container">
                        <tbody>
                            <tr class="row">
                                <td class="item-name">
                                    @Html.LabelFor(model => model.Newsletter):
                                </td>
                                <td class="item-value">
                                    @Html.EditorFor(model => model.Newsletter)
                                    @Html.ValidationMessageFor(model => model.Newsletter)
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="clear">
                </div>
            }
            @if (Model.AllowCustomersToSetTimeZone || Model.LocationEnabled)
            {
                <div class="section-title">
                    @T("Account.Preferences")
                </div>
                <div class="clear">
                </div>
                <div class="section-body">
                    <table class="table-container">
                        <tbody>
                            @if (Model.AllowCustomersToSetTimeZone)
                            {
                                <tr class="row">
                                    <td class="item-name">
                                        @Html.LabelFor(model => model.TimeZoneId):
                                    </td>
                                    <td class="item-value">
                                        @Html.DropDownList("TimeZoneId", Model.AvailableTimeZones)
                                        @Html.ValidationMessageFor(model => model.TimeZoneId)
                                    </td>
                                </tr>
                            }
                            @if (Model.LocationEnabled)
                            {
                                <tr class="row">
                                    <td class="item-name">
                                        @Html.LabelFor(model => model.LocationCountryId):
                                    </td>
                                    <td class="item-value">
                                        @Html.DropDownList("LocationCountryId", Model.AvailableLocations)
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
                <div class="clear">
                </div>
            }
            <div class="section-title">
                @T("Account.YourPassword")
            </div>
            <div class="clear">
            </div>
            <div class="section-body">
                <table class="table-container">
                    <tbody>
                        <tr class="row">
                            <td class="item-name">
                                @Html.LabelFor(model => model.Password):
                            </td>
                            <td class="item-value">
                                @Html.EditorFor(model => model.Password)
                                @Html.ValidationMessageFor(model => model.Password)
                            </td>
                        </tr>
                        <tr class="row">
                            <td class="item-name">
                                @Html.LabelFor(model => model.ConfirmPassword):
                            </td>
                            <td class="item-value">
                                @Html.EditorFor(model => model.ConfirmPassword)
                                @Html.ValidationMessageFor(model => model.ConfirmPassword)
                            </td>
                        </tr>
                        @if (Model.DisplayCaptcha)
                        {
                        <tr class="row">
                            <td colspan="2">
                                @Html.Raw(Html.GenerateCaptcha())
                            </td>
                        </tr>
                        }
                    </tbody>
                </table>
            </div>
            <div class="clear">
            </div>
            <div class="button">
                <input type="submit" class="registernextstepbutton" id="register-button" value="@T("Account.Register.Button")" name="register-button" />
            </div>
        </div>
    </div>
}