CourseWork_SchoolStudyAgain/SchoolAgainStudy/TeacherWebClient/Views/Home/Tasks.cshtml

69 lines
1.2 KiB
Plaintext

@using SchoolAgainStudyContracts.ViewModel;
@model List<TaskViewModel>
@{
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<h1 class="display-4">Задания</h1>
</div>
<div class="text-center">
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<p>
<a asp-action="CreateTask">Создать задание</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Название
</th>
<th>
Дата выдачи
</th>
<th>
Срок сдачи
</th>
<th>
Материалы
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Title)
</td>
<td>
@Html.DisplayFor(modelItem => item.DateIssue)
</td>
<td>
@Html.DisplayFor(modelItem => item.DateDelivery)
</td>
<td>
<select asp-items="@(new SelectList(item.TaskMaterials,"Key", "Value.Title"))"></select>
</td>
<td>
<a href="@Url.Action("TaskSetting","Home", new {id=item.Id })"
class="btn btn-primary btn-lg">U</a>
</td>
</tr>
}
</tbody>
</table>
}
</div>