CourseWork/University/UniversityClientApp/Views/Home/Disciplines.cshtml

79 lines
2.0 KiB
Plaintext
Raw Normal View History

2024-05-27 23:53:45 +04:00
@using UniversityContracts.ViewModels
@model List<DisciplineViewModel>
@{
ViewData["Title"] = "Manage Disciplines";
}
<div class="text-center">
<h2 class="display-4">@ViewData["Title"]</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">Name:</div>
<div class="col-8">
<input type="text" name="name" id="name" class="form-control" />
</div>
</div>
<div class="row">
<div class="col-4">Description:</div>
<div class="col-8">
<textarea name="description" id="description" class="form-control"></textarea>
</div>
</div>
2024-05-27 23:53:45 +04:00
<div class="row">
<div class="col-4">Date:</div>
<div class="col-8">
<input type="date" name="date" id="date" class="form-control" />
</div>
</div>
<div class="row">
2024-05-27 23:53:45 +04:00
<div class="col-4">Teacher:</div>
<div class="col-8">
2024-05-27 23:53:45 +04:00
<select id="teacher" name="teacher" class="form-control" asp-items="@(new SelectList(@ViewBag.Teachers,"Id", "Name"))"></select>
</div>
</div>
2024-05-27 23:53:45 +04:00
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Create Discipline" class="btn btn-primary" />
</div>
</div>
</form>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
2024-05-27 23:53:45 +04:00
<th>Date</th>
<th>Teacher Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
2024-05-27 23:53:45 +04:00
@foreach (var item in Model)
{
<tr>
<td>
2024-05-27 23:53:45 +04:00
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Date)
</td>
<td>
2024-05-27 23:53:45 +04:00
@Html.DisplayFor(modelItem => item.TeacherName)
</td>
</tr>
2024-05-27 23:53:45 +04:00
}
</tbody>
</table>