@using OurUmbraco.Our
@using OurUmbraco.Our.Controllers
@inherits Umbraco.Web.Mvc.UmbracoViewPage<OurUmbraco.Our.Models.RegisterModel>
@{
    Html.EnableClientValidation(true);
    Html.EnableUnobtrusiveJavaScript(true);
}


<div id="update-avatar-dialog" class="community-dialog">
    <div>
        <p><b>Upload avatar</b></p>
        <p class="invalid-file">The select file type is invalid. File must be gif, png, jpg, jpeg.</p>
        <input type="file" name="file" id="file" data-action="/umbraco/api/community/imageupload" />
        <div style="text-align:center;">
            <button class="button transparent tiny">Cancel<div class="span" style="display:none;"><div class=" loader"></div></div></button>
        </div>
    </div>

</div>

<div class="profile-settings">
    <strong>Your details</strong>
    <div class="profile-settings-forms">

        @using (Html.BeginUmbracoForm<RegisterController>("HandleSubmit"))
        {
            @Html.ValidationSummary(true)
            @Html.AntiForgeryToken()

            <div class="avatar" id="avatar">
                <label for="avatar">
                    Avatar
                </label>

                <div class="avatar-image inked">
                    @if (Model.Avatar != null)
                    {
                        @Html.Raw(Utils.GetLocalAvatar(Model.Avatar ?? "", 100, ""))
                    }
                    else
                    {
                        @Html.Raw(Utils.GetLocalAvatar("/media/avatar/default.gif", 100, "Umbraco Logo"))
                    }
                    <span>Change image</span>
                </div>
                @Html.HiddenFor(m => m.Avatar)
                @Html.ValidationMessageFor(m => m.Avatar)
            </div>

            <div class="profile-input" id="username">
                @Html.LabelFor(m => m.Name)
                @Html.TextBoxFor(m => m.Name)
                @Html.ValidationMessageFor(m => m.Name)
            </div>


            <div class="profile-input" id="email">
                @Html.LabelFor(m => m.Email)
                @Html.TextBoxFor(m => m.Email)
                @Html.ValidationMessageFor(m => m.Email)

            </div>


            <div class="profile-input" id="password">
                @Html.LabelFor(m => m.Password)
                @Html.PasswordFor(m => m.Password, new { @class = "password-input" })
                @Html.ValidationMessageFor(m => m.Password)
            </div>

            <div class="profile-input confirm-password" id="repeat-password">
                @Html.LabelFor(m => m.RepeatPassword)
                @Html.PasswordFor(m => m.RepeatPassword, new { @class = "password-input" })
                @Html.ValidationMessageFor(m => m.Password)

            </div>


            <div class="profile-input" id="bio">
                @Html.LabelFor(m => m.Bio)
                @Html.TextAreaFor(m => m.Bio)

            </div>


            <div class="profile-input" id="twitter-alias">
                @Html.LabelFor(m => m.TwitterAlias)
                @Html.TextBoxFor(m => m.TwitterAlias)
            </div>


            <div class="profile-input" id="located-at">
                @Html.LabelFor(m => m.Location)
                @Html.TextBoxFor(m => m.Location)
            </div>


            <input class="button green" type="submit" value="Register">

        }

    </div>
</div>


