94 lines
5.1 KiB
Plaintext
94 lines
5.1 KiB
Plaintext
@using CandidateReviewContracts.ViewModels
|
|
@model UserViewModel
|
|
|
|
@{
|
|
ViewData["Title"] = "Профиль пользователя";
|
|
var userRole = APIClient.User?.Role == CandidateReviewDataModels.Enums.RoleEnum.Пользователь ? true : false;
|
|
}
|
|
|
|
<div class="container mt-5">
|
|
<div class="row">
|
|
<div class="col-md-4 mb-4">
|
|
<div class="card">
|
|
<img src="@(Model.AvatarFilePath ?? "https://cdn-icons-png.flaticon.com/512/18/18601.png")" style="max-width: 150px; max-height: 150px;" class="card-img-top img-fluid rounded-circle mx-auto d-block" alt="Аватар пользователя">
|
|
<div class="card-body text-center">
|
|
<h5 class="card-title mb-0">
|
|
@(string.IsNullOrEmpty(@Model?.Surname) ? "" : @Model?.Surname) @Model?.Name @(string.IsNullOrEmpty(@Model?.LastName) ? "" : @Model?.LastName)
|
|
</h5>
|
|
<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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if (userRole)
|
|
{
|
|
<div class="col-md-8">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2>Мои резюме</h2>
|
|
</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>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
|