PIbd-21_Pyatakov_KM_Markov_.../UniversityCustomer/Views/Home/Streams.cshtml

75 lines
1.9 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@using UniversityContracts.ViewModels
@{
ViewData["Title"] = "Потоки";
}
<div class="text-center">
<h1 class="display-4">Потоки</h1>
</div>
<div class="text-center">
@{
if (ViewBag.Streams == null)
{
<h3 class="display-4">Войдите в аккаунт</h3>
return;
}
<div>
<a class="btn btn-secondary" asp-controller="Stream" asp-action="Create">Добавить поток</a>
</div>
<div class="d-flex mb-2 gap-1">
<div class="input-group" style="width: auto;">
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
</div>
<a href="/Home/Streams?page=@ViewBag.Page" id="go-button" class="button-primary text-button">
Перейти
</a>
</div>
<table class="table">
<thead>
<tr>
<th>
Название
</th>
<th>
Курс
</th>
<th>
Изменить запись
</th>
<th>
Удалить запись
</th>
</tr>
</thead>
<tbody>
@foreach (var item in ViewBag.Streams)
{
<tr class="d-table-row">
<td>
@item.Name
</td>
<td>
@item.Course.ToString()
</td>
<td>
<a id="update-button-@item.Id" class="btn btn-secondary" asp-controller="Stream" asp-action="Bind" asp-route-id="@item.Id">Добавить студентов</a>
</td>
<td>
<a id="update-button-@item.Id" class="btn btn-secondary" asp-controller="Stream" asp-action="Update" asp-route-id="@item.Id">Изменить</a>
</td>
<td>
<a id="remove-button-@item.Id" class="btn btn-secondary remove-btn" data-id="@item.Id">Удалить</a>
</td>
</tr>
}
</tbody>
</table>
}
</div>
<script src="~/js/stream/streams.js" asp-append-version="true"></script>