@using OurUmbraco.Our
@using OurUmbraco.Our.Controllers

@inherits Umbraco.Web.Mvc.UmbracoViewPage<OurUmbraco.Our.Models.ProfileModel>
@{
    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>Change your profile</strong>
        <div class="profile-settings-forms">

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

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

                    <div class="avatar-image inked">
                        @Html.Raw(Utils.GetLocalAvatar(Model.Avatar ?? "", 100, ""))
                        <span>Change image</span>
                    </div>
                    @Html.HiddenFor(m => m.Avatar)
                </div>

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

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

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

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

                <div class="profile-input" id="company">
                    @Html.LabelFor(m => m.Company)
                    @Html.TextBoxFor(m => m.Company)
                </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="Save changes">
                
                if (TempData["success"] != null)
                {
                    <small class="notification success">
                        Changes saved
                    </small>
                }

            }

        </div>
    </div>


