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

65 lines
2.3 KiB
Plaintext
Raw Normal View History

@using UniversityContracts.ViewModels
@model DisciplineViewModel
@{
ViewData["Title"] = "Дисциплина";
}
<div class="text-center">
<h2 class="display-4">@ViewData["Title"] - @Model.Id</h2>
</div>
<form asp-action="UpdateDiscipline" method="post">
<div class="row">
<div class="col-4">Название:</div>
<div class="col-8">
<input type="text" name="name" id="name" class="form-control" value="@Model.Name"/>
</div>
</div>
<div class="row">
<div class="col-4">Описание:</div>
<div class="col-8">
<input name="description" id="description" class="form-control" value="@Model.Description"></input>
</div>
</div>
<div class="row">
<div class="col-4">Дата:</div>
<div class="col-8">
<input type="date" name="date" id="date" class="form-control" value="@Model.Date" />
</div>
</div>
<div class="row">
<div class="col-4">Преподаватель:</div>
<div class="col-8">
<select id="teacher" name="teacher" class="form-control" asp-items="@(new SelectList(@ViewBag.Teachers,"Id", "Name"))" value="@Model.TeacherId"></select>
</div>
</div>
<div class="row">
<div class="col-4">Студенты:</div>
<div class="col-8">
<div class="scrollable-list">
@foreach (var student in ViewBag.Students)
{
<div class="form-check">
<input class="form-check-input" type="checkbox" name="studentIds" value="@student.Id" id="student-@student.Id" /
checked="@(Model.StudentDisciplines.ContainsKey(student.Id))">
<label class="form-check-label" for="student-@student.Id">
@student.Name
</label>
</div>
}
</div>
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<form asp-action="Disciplines">
<input type="submit" value="Отмена" class="btn btn-primary" />
</form>
<input type="hidden" name="id" value="@Model.Id" />
<input type="submit" value="Сохранить" class="btn btn-danger" />
</div>
</div>
</form>