2024-11-19 16:45:59 +04:00
@using CandidateReviewContracts.ViewModels
@using CandidateReviewDataModels.Enums
@model VacancyViewModel
@{
var title = @Model.Id <= 0 ? "Создать вакансию" : "Редактировать вакансию";
}
<div class="container">
<h1>@title</h1>
<form method="post" class="row g-3 needs-validation" novalidate>
<input type="hidden" name="id" value="@Model?.Id" />
<input type="hidden" name="companyId" value="@(APIClient.User?.CompanyId)" />
<div class="col-md-6">
<label for="JobTitle" class="form-label">Название должности <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="JobTitle" name="JobTitle" value="@Model?.JobTitle" required placeholder="Введите название должности">
<div class="invalid-feedback">Пожалуйста, введите название должности.</div>
</div>
<div class="col-md-6">
<label for="requirements" class="form-label">Требования <span class="text-danger">*</span></label>
<textarea class="form-control" id="requirements" name="requirements" rows="3" placeholder="Введите требования к вакансии">@Model?.Requirements</textarea>
</div>
<div class="col-md-6">
<label for="Responsibilities" class="form-label">Обязанности <span class="text-danger">*</span></label>
<textarea class="form-control" id="Responsibilities" name="Responsibilities" rows="3" placeholder="Введите обязанности">@Model?.Responsibilities</textarea>
</div>
<div class="col-md-6">
2024-11-23 21:39:18 +04:00
<label asp-for="JobType" class="form-label">Тип занятости</label>
<select asp-for="JobType" class="form-control" asp-items="@GetJobTypeSelectList()"></select>
2024-11-19 16:45:59 +04:00
</div>
<div class="col-md-6">
<label for="salary" class="form-label">Заработная плата (р у б .)</label>
<input type="text" class="form-control" id="salary" name="salary" value="@Model?.Salary" placeholder="Введите заработную плату или поставьте '-'">
</div>
<div class="col-md-6">
<label for="description" class="form-label">Описание</label>
<input type="text" class="form-control" id="description" name="description" value="@Model?.Description" placeholder="Введите описание вакансии">
</div>
<div class="col-md-6">
2024-11-23 21:39:18 +04:00
<label asp-for="Status" class="form-label">Статус вакансии</label>
<select asp-for="Status" class="form-control" asp-items="@GetStatusSelectList()"></select>
2024-11-19 16:45:59 +04:00
</div>
<div class="col-md-6">
<label for="tags" class="form-label">Тэги</label>
2024-11-23 21:39:18 +04:00
<input type="text" class="form-control" id="tags" name="tags" value="@Model?.Tags" placeholder="Введите тэги через пробел">
2024-11-19 16:45:59 +04:00
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary">Сохранить</button>
</div>
</form>
</div>
2024-11-23 21:39:18 +04:00
@functions {
public SelectList GetJobTypeSelectList()
{
return new SelectList(Enum.GetValues(typeof(JobTypeEnum)).Cast<JobTypeEnum>());
}
public SelectList GetStatusSelectList()
{
return new SelectList(Enum.GetValues(typeof(VacancyStatusEnum)).Cast<VacancyStatusEnum>());
}
}
2024-11-19 16:45:59 +04:00
<script>
(function () {
'use strict'
var forms = document.querySelectorAll('.needs-validation')
Array.prototype.slice.call(forms)
.forEach(function (form) {
form.addEventListener('submit', function (event) {
if (!form.checkValidity()) {
event.preventDefault()
event.stopPropagation()
}
form.classList.add('was-validated')
}, false)
})
})()
</script>