2024-11-18 23:37:50 +04:00
|
|
|
@using CandidateReviewContracts.ViewModels
|
|
|
|
@model UserViewModel
|
|
|
|
|
|
|
|
@{
|
|
|
|
ViewData["Title"] = "Профиль пользователя";
|
2024-12-09 02:10:45 +04:00
|
|
|
var userRole = APIClient.User?.Role == CandidateReviewDataModels.Enums.RoleEnum.Пользователь ? true : false;
|
2024-11-18 23:37:50 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
<div class="container mt-5">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4 mb-4">
|
2024-12-12 01:54:07 +04:00
|
|
|
<div class="card shadow-sm">
|
|
|
|
<img src="@(Model.AvatarFilePath ?? "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="Аватар пользователя">
|
2024-11-18 23:37:50 +04:00
|
|
|
<div class="card-body text-center">
|
|
|
|
<h5 class="card-title mb-0">
|
2024-12-09 02:10:45 +04:00
|
|
|
@(string.IsNullOrEmpty(@Model?.Surname) ? "" : @Model?.Surname) @Model?.Name @(string.IsNullOrEmpty(@Model?.LastName) ? "" : @Model?.LastName)
|
2024-11-18 23:37:50 +04:00
|
|
|
</h5>
|
2024-11-19 16:45:59 +04:00
|
|
|
<dl class="row mt-3">
|
|
|
|
<dt class="col-sm-4">Email:</dt>
|
|
|
|
<dd class="col-sm-8">@Model?.Email</dd>
|
|
|
|
@if (!string.IsNullOrEmpty(@Model?.PhoneNumber))
|
|
|
|
{
|
|
|
|
<dt class="col-sm-4">Телефон:</dt>
|
|
|
|
<dd class="col-sm-8">@Model?.PhoneNumber</dd>
|
|
|
|
}
|
|
|
|
<dt class="col-sm-4">Роль:</dt>
|
|
|
|
<dd class="col-sm-8">@Model?.Role</dd>
|
|
|
|
</dl>
|
|
|
|
<div class="btn-group mt-3" role="group" aria-label="Действия">
|
|
|
|
<a asp-action="UserProfileEdit" asp-controller="User" asp-route-id="@Model?.Id" class="btn btn-primary">Редактировать профиль</a>
|
|
|
|
<form asp-action="Delete" asp-controller="User" method="post" onsubmit="return confirm('Вы уверены, что хотите удалить профиль?');">
|
|
|
|
<input type="hidden" name="id" value="@Model?.Id" />
|
|
|
|
<button type="submit" class="btn btn-danger">Удалить профиль</button>
|
|
|
|
</form>
|
|
|
|
<a asp-action="Logout" asp-controller="User" class="btn btn-secondary">Выйти</a>
|
|
|
|
</div>
|
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)
|
|
|
|
{
|
|
|
|
<div class="col-md-8">
|
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>
|
2024-12-12 01:54:07 +04:00
|
|
|
<a asp-action="CreateResume" asp-controller="Resume" class="btn btn-success">Создать резюме</a>
|
2024-12-09 02:10:45 +04:00
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
@if (Model.Resumes != null && Model.Resumes.Any())
|
|
|
|
{
|
|
|
|
<table class="table table-striped">
|
|
|
|
<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>
|
|
|
|
<a asp-action="ResumeDetails" asp-controller="Resume" asp-route-id="@resume.Id" class="text-info" title="Просмотр">
|
|
|
|
<i class="bi bi-eye"></i>
|
|
|
|
</a>
|
|
|
|
<a asp-action="EditResume" asp-controller="Resume" asp-route-id="@resume.Id" class="text-warning" title="Редактировать">
|
|
|
|
<i class="bi bi-pencil"></i>
|
|
|
|
</a>
|
|
|
|
<a asp-action="Delete" asp-controller="Resume" asp-route-id="@resume.Id" class="text-danger" title="Удалить" onclick="return confirm('Вы уверены, что хотите удалить резюме?');">
|
|
|
|
<i class="bi bi-trash"></i>
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<p>Нет резюме.</p>
|
|
|
|
}
|
|
|
|
</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;
|
|
|
|
}
|
|
|
|
|
|
|
|
.table th, .table td {
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
|
|
|
|
.btn-sm {
|
|
|
|
font-size: 0.875rem;
|
|
|
|
padding: 0.375rem 0.75rem;
|
|
|
|
width: 100%;
|
|
|
|
margin-bottom: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.btn-info, .btn-success {
|
|
|
|
margin-right: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.input-group {
|
|
|
|
border-radius: 5px;
|
|
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-control {
|
|
|
|
border-radius: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-control:focus {
|
|
|
|
border-color: #80bdff;
|
|
|
|
box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
|
|
|
|
}
|
|
|
|
|
|
|
|
.table-striped tbody tr:nth-of-type(odd) {
|
|
|
|
background-color: #f9f9f9;
|
|
|
|
}
|
|
|
|
|
|
|
|
.table-light {
|
|
|
|
background-color: #f8f9fa;
|
|
|
|
}
|
|
|
|
|
|
|
|
.text-muted {
|
|
|
|
font-style: italic;
|
|
|
|
}
|
|
|
|
|
|
|
|
.text-danger {
|
|
|
|
color: #dc3545;
|
|
|
|
}
|
|
|
|
|
|
|
|
.text-center {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
@section Scripts {
|
|
|
|
<script>
|
|
|
|
document.querySelectorAll('form[onsubmit]').forEach(function (form) {
|
|
|
|
form.addEventListener('submit', function (event) {
|
|
|
|
if (!confirm('Вы уверены, что хотите удалить?')) {
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
}
|