102 lines
4.1 KiB
Plaintext
102 lines
4.1 KiB
Plaintext
@using CandidateReviewContracts.ViewModels
|
|
@model List<UserViewModel>
|
|
|
|
@{
|
|
ViewData["Title"] = "Сотрудники компании";
|
|
}
|
|
|
|
<div class="container mt-5">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-12">
|
|
<h1 class="mb-4 text-center">Сотрудники</h1>
|
|
<div class="mb-4 text-end">
|
|
<a asp-action="UserProfileEdit" asp-controller="User" asp-route-companyId="@APIClient.Company.Id" class="btn btn-success">
|
|
<i class="bi bi-plus-circle me-2"></i> Добавить сотрудника
|
|
</a>
|
|
</div>
|
|
@if (Model != null)
|
|
{
|
|
@if (Model.Any())
|
|
{
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-hover align-middle">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>Фамилия</th>
|
|
<th>Имя</th>
|
|
<th>Эл. почта</th>
|
|
<th>Номер телефона</th>
|
|
<th>Действия</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var employee in Model)
|
|
{
|
|
<tr>
|
|
<td>@employee.Surname</td>
|
|
<td>@employee.Name</td>
|
|
<td>@employee.Email</td>
|
|
<td>@employee.PhoneNumber</td>
|
|
<td>
|
|
<a asp-action="UserProfile" asp-controller="User" asp-route-id="@employee.Id" class="btn btn-info btn-sm me-2" title="Просмотр">
|
|
<i class="bi bi-eye"></i> Просмотр
|
|
</a>
|
|
|
|
<a asp-action="UserProfileEdit" asp-controller="User" asp-route-id="@employee.Id" class="btn btn-warning btn-sm me-2" title="Редактировать">
|
|
<i class="bi bi-pencil"></i> Редактировать
|
|
</a>
|
|
|
|
<a asp-action="Delete" asp-controller="User" asp-route-id="@employee.Id" class="btn btn-danger btn-sm me-2" title="Удалить" onclick="return confirm('Вы уверены, что хотите удалить сотрудника?');">
|
|
<i class="bi bi-trash"></i> Удалить
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<p class="text-center text-muted">Сотрудников нет.</p>
|
|
}
|
|
}
|
|
else
|
|
{
|
|
<p class="text-center text-danger">Произошла ошибка при получении данных.</p>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
.table-hover tbody tr:hover {
|
|
background-color: #f1f1f1;
|
|
}
|
|
|
|
.btn-info, .btn-warning, .btn-danger {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.btn-info i, .btn-warning i, .btn-danger i {
|
|
margin-right: 5px;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.btn:hover {
|
|
background-color: #1C3273;
|
|
transform: scale(1.05);
|
|
}
|
|
</style>
|