89 lines
3.3 KiB
Plaintext
Raw Normal View History

@using CandidateReviewContracts.ViewModels
@model List<CriterionViewModel>
@{
ViewData["Title"] = "Управление критериями";
}
<div class="container mt-5">
<div class="d-flex justify-content-between mb-3">
<h2>Управление критериями</h2>
<button class="btn btn-secondary" onclick="window.history.back();">Назад</button>
</div>
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Название критерия</th>
<th>Действия</th>
</tr>
</thead>
<tbody>
@if (Model != null && Model.Count > 0)
{
int index = 1;
foreach (var criterion in Model)
{
<tr>
<td>@index</td>
<td>@criterion.Name</td>
<td>
<a asp-action="Delete" asp-controller="Criterion" asp-route-id="@criterion.Id" class="btn btn-danger btn-sm" onclick="return confirm('Вы уверены, что хотите удалить критерий?');">Удалить</a>
</td>
</tr>
index++;
}
}
else
{
<tr>
<td colspan="3" class="text-center">Нет доступных критериев.</td>
</tr>
}
</tbody>
</table>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addCriterionModal">
Добавить критерий
</button>
</div>
<div class="modal fade" id="addCriterionModal" tabindex="-1" aria-labelledby="addCriterionModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form method="post" asp-controller="Criterion" asp-action="AddCriterion">
<div class="modal-header">
<h5 class="modal-title" id="addCriterionModalLabel">Добавить критерий</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="criterionName" class="form-label">Название критерия</label>
<input type="text" class="form-control" id="criterionName" name="name" required />
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Сохранить</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
</div>
</form>
</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>