2024-11-18 23:37:50 +04:00
|
|
|
|
@using CandidateReviewContracts.ViewModels
|
|
|
|
|
@model UserViewModel
|
|
|
|
|
|
|
|
|
|
@{
|
|
|
|
|
ViewData["Title"] = "Профиль пользователя";
|
2024-12-13 04:12:54 +04:00
|
|
|
|
var userRole = APIClient.User?.Role == CandidateReviewDataModels.Enums.RoleEnum.Пользователь || APIClient.User?.Role == CandidateReviewDataModels.Enums.RoleEnum.Администратор ? true : false;
|
2024-11-18 23:37:50 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<div class="container mt-5">
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div class="card shadow-lg p-4 rounded">
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
<img src="https://cdn-icons-png.flaticon.com/512/18/18601.png"
|
|
|
|
|
class="card-img-top img-fluid rounded-circle mx-auto d-block"
|
|
|
|
|
style="max-width: 150px; max-height: 150px;" alt="Аватар пользователя">
|
|
|
|
|
</div>
|
2024-11-18 23:37:50 +04:00
|
|
|
|
<div class="card-body text-center">
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<h3 class="card-title mb-2">
|
|
|
|
|
@(string.IsNullOrEmpty(@Model?.Surname) ? "" : @Model?.Surname)
|
|
|
|
|
@Model?.Name
|
|
|
|
|
@(string.IsNullOrEmpty(@Model?.LastName) ? "" : @Model?.LastName)
|
|
|
|
|
</h3>
|
2024-11-19 16:45:59 +04:00
|
|
|
|
<dl class="row mt-3">
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<dt class="col-sm-4 text-muted">Email:</dt>
|
2024-11-19 16:45:59 +04:00
|
|
|
|
<dd class="col-sm-8">@Model?.Email</dd>
|
|
|
|
|
@if (!string.IsNullOrEmpty(@Model?.PhoneNumber))
|
|
|
|
|
{
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<dt class="col-sm-4 text-muted">Телефон:</dt>
|
2024-11-19 16:45:59 +04:00
|
|
|
|
<dd class="col-sm-8">@Model?.PhoneNumber</dd>
|
|
|
|
|
}
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<dt class="col-sm-4 text-muted">Роль:</dt>
|
2024-11-19 16:45:59 +04:00
|
|
|
|
<dd class="col-sm-8">@Model?.Role</dd>
|
|
|
|
|
</dl>
|
2024-12-13 04:12:54 +04:00
|
|
|
|
|
|
|
|
|
<div class="btn-group mt-4" role="group" aria-label="Действия">
|
|
|
|
|
<a asp-action="UserProfileEdit" asp-controller="User" asp-route-id="@Model?.Id"
|
|
|
|
|
class="btn btn-outline-primary px-4 py-2 me-2">
|
|
|
|
|
<i class="bi bi-pencil me-2"></i>Редактировать профиль
|
|
|
|
|
</a>
|
|
|
|
|
<form asp-action="Delete" asp-controller="User" method="post"
|
|
|
|
|
onsubmit="return confirm('Вы уверены, что хотите удалить профиль?');" class="d-inline me-2">
|
2024-11-19 16:45:59 +04:00
|
|
|
|
<input type="hidden" name="id" value="@Model?.Id" />
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<button type="submit" class="btn btn-outline-danger px-4 py-2">
|
|
|
|
|
<i class="bi bi-trash me-2"></i>Удалить профиль
|
|
|
|
|
</button>
|
2024-11-19 16:45:59 +04:00
|
|
|
|
</form>
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<a asp-action="Logout" asp-controller="User" class="btn btn-outline-secondary px-4 py-2">
|
|
|
|
|
<i class="bi bi-box-arrow-right me-2"></i>Выйти
|
|
|
|
|
</a>
|
2024-11-19 16:45:59 +04:00
|
|
|
|
</div>
|
2024-12-13 04:12:54 +04:00
|
|
|
|
|
2024-11-18 23:37:50 +04:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-11-19 16:45:59 +04:00
|
|
|
|
|
2024-12-09 02:10:45 +04:00
|
|
|
|
@if (userRole)
|
|
|
|
|
{
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<div class="col-md-8 mt-4">
|
2024-12-12 01:54:07 +04:00
|
|
|
|
<div class="card shadow-sm mb-4">
|
|
|
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
2024-12-09 02:10:45 +04:00
|
|
|
|
<h2>Мои резюме</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
@if (Model.Resumes != null && Model.Resumes.Any())
|
|
|
|
|
{
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<table class="table table-striped table-hover">
|
2024-12-09 02:10:45 +04:00
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>Название</th>
|
|
|
|
|
<th>Вакансия</th>
|
|
|
|
|
<th>Статус</th>
|
|
|
|
|
<th>Действия</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
@foreach (var resume in Model.Resumes)
|
|
|
|
|
{
|
|
|
|
|
<tr>
|
|
|
|
|
<td>@resume.Title</td>
|
|
|
|
|
<td>@resume.VacancyName</td>
|
|
|
|
|
<td>@resume.Status</td>
|
|
|
|
|
<td>
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<a asp-action="ResumeDetails" asp-controller="Resume" asp-route-id="@resume.Id" class="btn btn-info btn-sm me-2" title="Просмотр">
|
2024-12-09 02:10:45 +04:00
|
|
|
|
<i class="bi bi-eye"></i>
|
|
|
|
|
</a>
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<a asp-action="EditResume" asp-controller="Resume" asp-route-id="@resume.Id" class="btn btn-warning btn-sm me-2" title="Редактировать">
|
2024-12-09 02:10:45 +04:00
|
|
|
|
<i class="bi bi-pencil"></i>
|
|
|
|
|
</a>
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<a asp-action="Delete" asp-controller="Resume" asp-route-id="@resume.Id" class="btn btn-danger btn-sm me-2" title="Удалить" onclick="return confirm('Вы уверены, что хотите удалить резюме?');">
|
2024-12-09 02:10:45 +04:00
|
|
|
|
<i class="bi bi-trash"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-13 04:12:54 +04:00
|
|
|
|
<p class="text-muted">У вас нет резюме.</p>
|
2024-12-09 02:10:45 +04:00
|
|
|
|
}
|
|
|
|
|
</div>
|
2024-11-18 23:37:50 +04:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-12-09 02:10:45 +04:00
|
|
|
|
}
|
2024-11-18 23:37:50 +04:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-12-12 01:54:07 +04:00
|
|
|
|
<style>
|
|
|
|
|
body {
|
|
|
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
h1, h2 {
|
|
|
|
|
color: #333;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.table {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-13 04:12:54 +04:00
|
|
|
|
.table th, .table td {
|
|
|
|
|
vertical-align: middle;
|
2024-12-12 01:54:07 +04:00
|
|
|
|
}
|
|
|
|
|
|
2024-12-13 04:12:54 +04:00
|
|
|
|
.btn {
|
|
|
|
|
background-color: #0A1128;
|
|
|
|
|
color: white;
|
|
|
|
|
border: none;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
padding: 12px;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
transition: background-color 0.3s ease, transform 0.2s ease;
|
2024-12-12 01:54:07 +04:00
|
|
|
|
}
|
|
|
|
|
|
2024-12-13 04:12:54 +04:00
|
|
|
|
.btn:hover {
|
|
|
|
|
background-color: #1C3273;
|
|
|
|
|
transform: scale(1.05);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-12 01:54:07 +04:00
|
|
|
|
.input-group {
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-13 04:12:54 +04:00
|
|
|
|
.btn-group .btn {
|
|
|
|
|
border-radius: 15px; /* скругление кнопок внутри группы */
|
2024-12-12 01:54:07 +04:00
|
|
|
|
}
|
|
|
|
|
|
2024-12-13 04:12:54 +04:00
|
|
|
|
.btn-group button, .btn-group a {
|
|
|
|
|
border-radius: 15px; /* добавлено для кнопок внутри .btn-group */
|
2024-12-12 01:54:07 +04:00
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
@section Scripts {
|
|
|
|
|
<script>
|
|
|
|
|
document.querySelectorAll('form[onsubmit]').forEach(function (form) {
|
|
|
|
|
form.addEventListener('submit', function (event) {
|
|
|
|
|
if (!confirm('Вы уверены, что хотите удалить?')) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
}
|