100 lines
4.5 KiB
Plaintext
100 lines
4.5 KiB
Plaintext
|
@using CandidateReviewContracts.ViewModels
|
||
|
@model UserViewModel
|
||
|
|
||
|
@{
|
||
|
ViewData["Title"] = "Редактирование профиля";
|
||
|
}
|
||
|
|
||
|
<div class="container mt-5">
|
||
|
<div class="row justify-content-center">
|
||
|
<div class="col-md-6">
|
||
|
<h2 class="mb-4">Редактирование профиля</h2>
|
||
|
<form method="post" class="needs-validation" novalidate>
|
||
|
<input type="hidden" name="id" value="@Model?.Id" />
|
||
|
|
||
|
<div class="mb-3">
|
||
|
<label for="Name" class="form-label">Имя <span class="text-danger">*</span></label>
|
||
|
<input type="text" class="form-control" id="Name" name="Name" value="@Model?.Name" required />
|
||
|
<div class="invalid-feedback">Пожалуйста, введите имя.</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="mb-3">
|
||
|
<label for="Surname" class="form-label">Фамилия <span class="text-danger">*</span></label>
|
||
|
<input type="text" class="form-control" id="Surname" name="Surname" value="@Model?.Surname" required />
|
||
|
<div class="invalid-feedback">Пожалуйста, введите фамилию.</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="mb-3">
|
||
|
<label for="LastName" class="form-label">Отчество</label>
|
||
|
<input type="text" class="form-control" id="LastName" name="LastName" value="@Model?.LastName" />
|
||
|
<div class="invalid-feedback">Пожалуйста, введите отчество.</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="mb-3">
|
||
|
<label for="PhoneNumber" class="form-label">Телефон</label>
|
||
|
<input type="tel" class="form-control" id="PhoneNumber" name="PhoneNumber" value="@Model?.PhoneNumber" />
|
||
|
<div class="invalid-feedback">Пожалуйста, введите телефон.</div>
|
||
|
</div>
|
||
|
|
||
|
<input type="hidden" name="Email" value="@Model?.Email" />
|
||
|
<input type="hidden" name="Password" value="@Model?.Password" />
|
||
|
<input type="hidden" name="Role" value="@Model?.Role" />
|
||
|
<input type="hidden" name="CompanyId" value="@Model?.CompanyId" />
|
||
|
|
||
|
<div class="mb-3">
|
||
|
<label for="AvatarFilePath" class="form-label">Аватар</label>
|
||
|
<input type="file" class="form-control" id="AvatarFilePath" name="AvatarFilePath" value="@Model?.AvatarFilePath" accept=".jpg,.jpeg,.png" />
|
||
|
<div class="invalid-feedback">Выберите файл изображения.</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="d-flex justify-content-between">
|
||
|
<button type="submit" class="btn btn-primary">Сохранить</button>
|
||
|
<a asp-controller="User" asp-action="UserProfile" class="btn btn-secondary">Отмена</a>
|
||
|
</div>
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
@section Scripts {
|
||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/5.0.7-beta.29/jquery.inputmask.min.js"></script>
|
||
|
<script>
|
||
|
$(document).ready(function () {
|
||
|
$('#PhoneNumber').inputmask({
|
||
|
mask: '+7 (999) 999-99-99', // Adjust mask as needed
|
||
|
showMaskOnHover: false,
|
||
|
onincomplete: function () {
|
||
|
$(this).removeClass('is-valid').addClass('is-invalid');
|
||
|
},
|
||
|
oncleared: function () {
|
||
|
$(this).removeClass('is-valid is-invalid');
|
||
|
},
|
||
|
oncomplete: function () {
|
||
|
$(this).removeClass('is-invalid').addClass('is-valid');
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
|
||
|
(function () {
|
||
|
'use strict'
|
||
|
var forms = document.querySelectorAll('.needs-validation')
|
||
|
Array.prototype.slice.call(forms)
|
||
|
.forEach(function (form) {
|
||
|
form.addEventListener('submit', function (event) {
|
||
|
if (!form.checkValidity()) {
|
||
|
event.preventDefault()
|
||
|
event.stopPropagation()
|
||
|
}
|
||
|
form.classList.add('was-validated')
|
||
|
}, false)
|
||
|
})
|
||
|
})()
|
||
|
</script>
|
||
|
@{
|
||
|
await Html.RenderPartialAsync("_ValidationScriptsPartial");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|