181 lines
9.5 KiB
Plaintext
181 lines
9.5 KiB
Plaintext
@using CandidateReviewContracts.ViewModels
|
||
@model CompanyViewModel
|
||
|
||
@{
|
||
ViewData["Title"] = "Профиль компании";
|
||
var isAdmin = APIClient.User.Role == CandidateReviewDataModels.Enums.RoleEnum.Администратор ? true : false;
|
||
}
|
||
|
||
<div class="container mt-5">
|
||
<div class="row g-4">
|
||
<div class="col-md-4">
|
||
<div class="card shadow-sm">
|
||
<img src="@(Model.LogoFilePath ?? "https://static.thenounproject.com/png/2504969-200.png")"
|
||
class="card-img-top img-fluid rounded-circle mx-auto d-block" alt="Логотип компании"
|
||
style="max-width: 150px; max-height: 150px;">
|
||
<div class="card-body">
|
||
<h5 class="card-title">@Model.Name</h5>
|
||
<input type="hidden" name="id" value="@Model?.Id" />
|
||
<p class="card-text">@((Model.Description ?? "Описание отсутствует"))</p>
|
||
<a href="@(Model.Website ?? "#")"
|
||
target="_blank"
|
||
class="btn btn-primary mt-2 @(Model.Website == null ? "disabled" : "")"
|
||
@(Model.Website == null ? "aria-disabled=\"true\"" : "")>
|
||
@(Model.Website != null ? "Официальный сайт" : "Веб-сайт отсутствует")
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-md-8">
|
||
<div class="card mb-4 shadow-sm">
|
||
<div class="card-header d-flex justify-content-between align-items-center">
|
||
<h2>Информация о компании</h2>
|
||
<a asp-action="EditCompanyProfile" asp-controller="Company" asp-route-id="@Model.Id"
|
||
class="btn btn-warning">Редактировать</a>
|
||
</div>
|
||
<div class="card-body">
|
||
<dl class="row">
|
||
<dt class="col-sm-3">Адрес:</dt>
|
||
<dd class="col-sm-9">@((Model.Address?.ToString() ?? "Адрес не указан"))</dd>
|
||
|
||
<dt class="col-sm-3">Контакты:</dt>
|
||
<dd class="col-sm-9">@((Model.Contacts ?? "Контакты не указаны"))</dd>
|
||
</dl>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="card mb-4 shadow-sm">
|
||
<div class="card-header d-flex justify-content-between align-items-center">
|
||
<h2>Вакансии компании</h2>
|
||
<a asp-action="EditVacancy" asp-controller="Vacancy" asp-route-companyId="@Model.Id"
|
||
class="btn btn-success"> <i class="bi bi-plus-circle me-2"></i> Добавить вакансию</a>
|
||
</div>
|
||
<div class="card-body">
|
||
@if (Model.Vacancies != null && Model.Vacancies.Any())
|
||
{
|
||
<div class="table-responsive">
|
||
<table class="table table-striped table-hover align-middle" id="vacancies">
|
||
<thead class="table-light">
|
||
<tr>
|
||
<th>Название вакансии</th>
|
||
<th>Статус</th>
|
||
<th>Действия</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach (var vacancy in Model.Vacancies.Take(5))
|
||
{
|
||
<tr>
|
||
<td>@vacancy.JobTitle</td>
|
||
<td>@vacancy.Status</td>
|
||
<td>
|
||
<div class="d-flex justify-content-center">
|
||
<a asp-action="VacancyDetails" asp-controller="Vacancy" asp-route-id="@vacancy.Id"
|
||
class="btn btn-info btn-sm me-2" title="Просмотр">
|
||
<i class="bi bi-eye"></i>
|
||
</a>
|
||
<a asp-action="EditVacancy" asp-controller="Vacancy" asp-route-id="@vacancy.Id"
|
||
class="btn btn-warning btn-sm me-2" title="Редактировать">
|
||
<i class="bi bi-pencil-square"></i>
|
||
</a>
|
||
<a asp-action="Delete" asp-controller="Vacancy" asp-route-id="@vacancy.Id"
|
||
class="btn btn-danger btn-sm" title="Удалить"
|
||
onclick="return confirm('Вы уверены, что хотите удалить вакансию?');">
|
||
<i class="bi bi-trash"></i>
|
||
</a>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
@if (Model.Vacancies.Count() > 5)
|
||
{
|
||
<a asp-action="Vacancies" asp-controller="Vacancy" asp-route-companyId="@Model.Id"
|
||
class="btn btn-primary mt-3">Посмотреть все</a>
|
||
}
|
||
}
|
||
else
|
||
{
|
||
<p>Вакансий нет.</p>
|
||
}
|
||
</div>
|
||
</div>
|
||
|
||
<div class="card shadow-sm">
|
||
<div class="card-header d-flex justify-content-between align-items-center">
|
||
<h2>Сотрудники компании</h2>
|
||
@if (@isAdmin) {
|
||
<a asp-action="UserProfileEdit" asp-controller="User" asp-route-companyId="@Model.Id"
|
||
class="btn btn-success"> <i class="bi bi-plus-circle me-2"></i> Добавить сотрудника</a>
|
||
}
|
||
</div>
|
||
<div class="card-body">
|
||
@if (Model.Employees != null && Model.Employees.Any())
|
||
{
|
||
|
||
<div class="table-responsive">
|
||
<table class="table table-striped table-hover align-middle" id="employees">
|
||
<thead class="table-light">
|
||
<tr>
|
||
<th>Фамилия</th>
|
||
<th>Имя</th>
|
||
<th>Эл. почта</th>
|
||
<th>Действия</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach (var employee in Model.Employees.Take(5))
|
||
{
|
||
<tr>
|
||
<td>@employee.Surname</td>
|
||
<td>@employee.Name</td>
|
||
<td>@employee.Email</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="DeleteEmployee" 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>Сотрудников нет.</p>
|
||
}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<style>
|
||
.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>
|