|
|
@ -28,129 +28,154 @@ |
|
|
@ViewBag.ErrorMessage |
|
|
@ViewBag.ErrorMessage |
|
|
</div> |
|
|
</div> |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
<div class="row profile-section"> |
|
|
<div class="col profile-picture-col"> |
|
|
<div class="col profile-picture-col"> |
|
|
<img class="profile-picture" src="@Model.PictureUrl" /> |
|
|
<img class="profile-picture" src="@Url.Content($"~/../api/users/{Model.Id}/picture/")" /> |
|
|
</div> |
|
|
</div> |
|
|
<div class="col"> |
|
|
<div class="col"> |
|
|
<form class="profile-form" asp-controller="Profile" asp-action="Profile" method="post"> |
|
|
<form id="pictureForm" class="profile-picture-form" asp-controller="Profile" asp-action="UploadPicture" method="post" enctype="multipart/form-data"> |
|
|
<div class="form-group"> |
|
|
<span class="btn btn-secondary" id="pictureButton"> |
|
|
<label for="email">Email</label> |
|
|
<span>Upload Picture</span> |
|
|
|
|
|
|
|
|
|
|
|
<input class="profile-picture-input" name="file" type="file" id="pictureInput" /> |
|
|
|
|
|
</span> |
|
|
|
|
|
</form> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<form class="profile-form profile-section" asp-controller="Profile" asp-action="Profile" method="post"> |
|
|
|
|
|
<div class="form-group"> |
|
|
|
|
|
<label for="email">Email</label> |
|
|
|
|
|
|
|
|
@if (ViewContext.ViewData.ModelState["Email"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
@if (ViewContext.ViewData.ModelState["Email"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
{ |
|
|
{ |
|
|
<div class="errors-container"> |
|
|
<div class="errors-container"> |
|
|
<span asp-validation-for="Email" class="errors"></span> |
|
|
<span asp-validation-for="Email" class="errors"></span> |
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
<input type="email" ap class="form-control" asp-for="Email" name="email" id="email" /> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
<input type="email" ap class="form-control" asp-for="Email" name="email" id="email" /> |
|
|
<label for="displayName">Display Name</label> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@if (ViewContext.ViewData.ModelState["DisplayName"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
<div class="form-group"> |
|
|
{ |
|
|
<label for="displayName">Display Name</label> |
|
|
<div class="errors-container"> |
|
|
|
|
|
<span asp-validation-for="DisplayName" class="errors"></span> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
<input type="text" class="form-control" asp-for="DisplayName" name="displayName" id="displayName"/> |
|
|
@if (ViewContext.ViewData.ModelState["DisplayName"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
|
|
|
{ |
|
|
|
|
|
<div class="errors-container"> |
|
|
|
|
|
<span asp-validation-for="DisplayName" class="errors"></span> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
<button type="submit" class="btn btn-primary">Save</button> |
|
|
<input type="text" class="form-control" asp-for="DisplayName" name="displayName" id="displayName"/> |
|
|
</form> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<button type="submit" class="btn btn-primary">Save</button> |
|
|
|
|
|
</form> |
|
|
|
|
|
|
|
|
@if (Model.HasPasswordAuth) |
|
|
<div class="profile-section"> |
|
|
{ |
|
|
@if (Model.HasPasswordAuth) |
|
|
<h2>Password</h2> |
|
|
{ |
|
|
|
|
|
<h2>Password</h2> |
|
|
@if (Model.HasPassword) |
|
|
|
|
|
{ |
|
|
@if (Model.HasPassword) |
|
|
<form class="profile-form" asp-controller="Profile" asp-action="ChangePassword" method="post"> |
|
|
{ |
|
|
<div class="form-group"> |
|
|
<form class="profile-form" asp-controller="Profile" asp-action="ChangePassword" method="post"> |
|
|
<label for="oldPassword">Old Password</label> |
|
|
<div class="form-group"> |
|
|
|
|
|
<label for="oldPassword">Old Password</label> |
|
|
@if (ViewContext.ViewData.ModelState["OldPassword"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
|
|
|
{ |
|
|
@if (ViewContext.ViewData.ModelState["OldPassword"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
<div class="errors-container"> |
|
|
{ |
|
|
<span class="errors">@Html.ValidationMessage("OldPassword")</span> |
|
|
<div class="errors-container"> |
|
|
</div> |
|
|
<span class="errors">@Html.ValidationMessage("OldPassword")</span> |
|
|
} |
|
|
</div> |
|
|
|
|
|
} |
|
|
<input type="password" class="form-control" name="oldPassword" id="oldPassword"/> |
|
|
|
|
|
</div> |
|
|
<input type="password" class="form-control" name="oldPassword" id="oldPassword" /> |
|
|
|
|
|
</div> |
|
|
<div class="form-group"> |
|
|
|
|
|
<label for="password">Password</label> |
|
|
<div class="form-group"> |
|
|
|
|
|
<label for="password">Password</label> |
|
|
@if (ViewContext.ViewData.ModelState["Password"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
|
|
|
{ |
|
|
@if (ViewContext.ViewData.ModelState["Password"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
<div class="errors-container"> |
|
|
{ |
|
|
<span class="errors">@Html.ValidationMessage("Password")</span> |
|
|
<div class="errors-container"> |
|
|
</div> |
|
|
<span class="errors">@Html.ValidationMessage("Password")</span> |
|
|
} |
|
|
</div> |
|
|
|
|
|
} |
|
|
<input type="password" class="form-control" name="password" id="password"/> |
|
|
|
|
|
</div> |
|
|
<input type="password" class="form-control" name="password" id="password" /> |
|
|
|
|
|
</div> |
|
|
<div class="form-group"> |
|
|
|
|
|
<label for="passwordConfirm">Confirm</label> |
|
|
<div class="form-group"> |
|
|
|
|
|
<label for="passwordConfirm">Confirm</label> |
|
|
@if (ViewContext.ViewData.ModelState["PasswordConfirm"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
|
|
|
{ |
|
|
@if (ViewContext.ViewData.ModelState["PasswordConfirm"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
<div class="errors-container"> |
|
|
{ |
|
|
<span class="errors">@Html.ValidationMessage("PasswordConfirm")</span> |
|
|
<div class="errors-container"> |
|
|
</div> |
|
|
<span class="errors">@Html.ValidationMessage("PasswordConfirm")</span> |
|
|
} |
|
|
</div> |
|
|
|
|
|
} |
|
|
<input type="password" class="form-control" name="passwordConfirm" id="passwordConfirm"/> |
|
|
|
|
|
</div> |
|
|
<input type="password" class="form-control" name="passwordConfirm" id="passwordConfirm" /> |
|
|
|
|
|
</div> |
|
|
<div class="form-group"> |
|
|
|
|
|
<button type="submit" class="btn btn-primary">Change Password</button> |
|
|
<div class="form-group"> |
|
|
</div> |
|
|
<button type="submit" class="btn btn-primary">Change Password</button> |
|
|
</form> |
|
|
</div> |
|
|
} |
|
|
</form> |
|
|
else |
|
|
} |
|
|
{ |
|
|
else |
|
|
<form class="profile-form" asp-controller="Profile" asp-action="SetPassword" method="post"> |
|
|
{ |
|
|
<div class="form-group"> |
|
|
<form class="profile-form" asp-controller="Profile" asp-action="SetPassword" method="post"> |
|
|
<label for="password">Password</label> |
|
|
<div class="form-group"> |
|
|
|
|
|
<label for="password">Password</label> |
|
|
@if (ViewContext.ViewData.ModelState["Password"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
|
|
|
{ |
|
|
@if (ViewContext.ViewData.ModelState["Password"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
<div class="errors-container"> |
|
|
{ |
|
|
<span class="errors">@Html.ValidationMessage("Password")</span> |
|
|
<div class="errors-container"> |
|
|
</div> |
|
|
<span class="errors">@Html.ValidationMessage("Password")</span> |
|
|
} |
|
|
</div> |
|
|
|
|
|
} |
|
|
<input type="password" class="form-control" name="password" id="password"/> |
|
|
|
|
|
</div> |
|
|
<input type="password" class="form-control" name="password" id="password" /> |
|
|
|
|
|
</div> |
|
|
<div class="form-group"> |
|
|
|
|
|
<label for="passwordConfirm">Confirm</label> |
|
|
<div class="form-group"> |
|
|
|
|
|
<label for="passwordConfirm">Confirm</label> |
|
|
@if (ViewContext.ViewData.ModelState["PasswordConfirm"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
|
|
|
{ |
|
|
@if (ViewContext.ViewData.ModelState["PasswordConfirm"]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
|
|
<div class="errors-container"> |
|
|
{ |
|
|
<span class="errors">@Html.ValidationMessage("PasswordConfirm")</span> |
|
|
<div class="errors-container"> |
|
|
</div> |
|
|
<span class="errors">@Html.ValidationMessage("PasswordConfirm")</span> |
|
|
} |
|
|
</div> |
|
|
|
|
|
} |
|
|
<input type="password" class="form-control" name="passwordConfirm" id="passwordConfirm"/> |
|
|
|
|
|
</div> |
|
|
<input type="password" class="form-control" name="passwordConfirm" id="passwordConfirm" /> |
|
|
|
|
|
</div> |
|
|
<div class="form-group"> |
|
|
|
|
|
<button type="submit" class="btn btn-primary">Set Password</button> |
|
|
<div class="form-group"> |
|
|
</div> |
|
|
<button type="submit" class="btn btn-primary">Set Password</button> |
|
|
</form> |
|
|
</div> |
|
|
} |
|
|
</form> |
|
|
} |
|
|
} |
|
|
</div> |
|
|
} |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
var pictureButton = document.getElementById('pictureButton'); |
|
|
|
|
|
var pictureInput = document.getElementById('pictureInput'); |
|
|
|
|
|
var pictureForm = document.getElementById('pictureForm'); |
|
|
|
|
|
|
|
|
|
|
|
pictureButton.addEventListener('click', |
|
|
|
|
|
function() { |
|
|
|
|
|
pictureInput.click(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
pictureInput.addEventListener('change', |
|
|
|
|
|
function () { |
|
|
|
|
|
pictureForm.submit(); |
|
|
|
|
|
}); |
|
|
|
|
|
</script> |