@using SportsDivision.Domain.Enums
@model EventUpdateDto
@{
    ViewData["Title"] = "Edit Event";
}

<h2>Edit Event</h2>
<hr />

<div class="row">
    <div class="col-md-6">
        <form asp-action="Edit" method="post">
            <div asp-validation-summary="All" class="text-danger"></div>
            <input type="hidden" asp-for="EventId" />
            @for (var i = 0; i < Model.EventLevelIds.Count; i++)
            {
                <input type="hidden" asp-for="EventLevelIds[i]" />
            }
            <div class="mb-3">
                <label asp-for="Name" class="form-label">Name</label>
                <input asp-for="Name" class="form-control" />
                <span asp-validation-for="Name" class="text-danger"></span>
            </div>
            <div class="mb-3">
                <label asp-for="Category" class="form-label">Category</label>
                <select asp-for="Category" asp-items="Html.GetEnumSelectList<EventCategory>()" class="form-select"></select>
            </div>
            <div class="form-check mb-2">
                <input asp-for="IsRelay" class="form-check-input" />
                <label asp-for="IsRelay" class="form-check-label">Relay event</label>
            </div>
            <div class="form-check mb-2">
                <input asp-for="PrimarySchool" class="form-check-input" />
                <label asp-for="PrimarySchool" class="form-check-label">Available to primary schools</label>
            </div>
            <div class="form-check mb-2">
                <input asp-for="SecondarySchool" class="form-check-input" />
                <label asp-for="SecondarySchool" class="form-check-label">Available to secondary schools</label>
            </div>
            <div class="form-check mb-3">
                <input asp-for="IsActive" class="form-check-input" />
                <label asp-for="IsActive" class="form-check-label">Active</label>
            </div>
            <button type="submit" class="btn btn-primary">Save</button>
            <a asp-action="Index" class="btn btn-secondary">Cancel</a>
        </form>
    </div>
</div>

@section Scripts { <partial name="_ValidationScriptsPartial" /> }
