@using UniversityContracts.ViewModels
@model PlanOfStudyViewModel
@{
	ViewData["Title"] = "План обучения";
}
<div class="text-center">
	<h2 class="display-4">@ViewData["Title"] - @Model.Id</h2>
</div>
<form asp-action="UpdatePlanOfStudy" method="post">
	<div class="row">
		<div class="col-4">Профиль:</div>
		<div class="col-8"><input type="text" name="profile" value="@Model.Profile" /></div>
	</div>
	<div class="row">
		<div class="col-4">Форма обучения:</div>
		<div class="col-8"><input type="text" name="formOfStudy" value="@Model.FormOfStudy" /></div>
	</div>
	<div class="row">
		<div class="col-4">Преподаватели:</div>
		<div class="col-8">
			@foreach (var teacher in ViewBag.Teachers)
			{
				<div class="form-check">
					<input class="form-check-input" type="checkbox" name="teacherIds" value="@teacher.Id" id="teacher-@teacher.Id"
						   checked="@(Model.PlanOfStudyTeachers.ContainsKey(teacher.Id))">
					<label class="form-check-label" for="teacher-@teacher.Id">
						@teacher.Name
					</label>
				</div>
			}
		</div>
	</div>
	<div class="row">
		<div class="col-8"></div>
		<div class="col-4">
			<form asp-action="Index">
				<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>